This is pretty frustrating as controller triggers go up to 255, 255 being fully pressed. Take a look at this XInputTest from microsoft
[center]
[/center]
num = math.floor(num * 255)
What’s the problem again?
[quote]
num = math.floor(num * 255)
What’s the problem again? [/quote]
Thanks :]
Although the result can be off sometimes by 1
Human hands can’t be that precise, so that amount of error is negligible.
num = math.floor(num*255+.5)
This rounds the number correctly
On another note, why do you need it in the range of 0-255 instead of a 0-1 ratio?
[quote]
num = math.floor(num * 255)
What’s the problem again? [/quote]
Thanks :]
Although the result can be off sometimes by 1
[/quote]
Don’t expect the player to have a brand new controller. Triggers and thumbsticks degrade over time. You should consider it to be fully pressed at 90%
[quote] [quote=“sncplay42” post=197363]
num = math.floor(num * 255)
What’s the problem again? [/quote]
Thanks :]
Although the result can be off sometimes by 1
[/quote]
Don’t expect the player to have a brand new controller. Triggers and thumbsticks degrade over time. You should consider it to be fully pressed at 90%[/quote]
Mine isn’t brand new, I’ve had it for about 14 months now only noticeable thing is the left trigger is a little squeaky.
[quote] [quote=“anon80475429” post=197369][quote=“sncplay42” post=197363]
num = math.floor(num * 255)
What’s the problem again? [/quote]
Thanks :]
Although the result can be off sometimes by 1
[/quote]
Don’t expect the player to have a brand new controller. Triggers and thumbsticks degrade over time. You should consider it to be fully pressed at 90%[/quote]
Mine isn’t brand new, I’ve had it for about 14 months now only noticeable thing is the left trigger is a little squeaky.[/quote]
Please don’t require super-precise controls.
I hooked my Wii U Pro controller up to my computer as an xBox controller, and the setup worked perfectly. However, when I tried to use it on Roblox, I discovered that my right joystick rests ever so slightly off-center, causing my camera to turn all the time and making it impossible to play.
My point being that you probably won’t have a lot of people playing with perfect controllers. I really wish Roblox allowed you to set sensitivity settings for gamepads
[quote] [quote=“Ethan” post=197377][quote=“anon80475429” post=197369][quote=“sncplay42” post=197363]
num = math.floor(num * 255)
What’s the problem again? [/quote]
Thanks :]
Although the result can be off sometimes by 1
[/quote]
Don’t expect the player to have a brand new controller. Triggers and thumbsticks degrade over time. You should consider it to be fully pressed at 90%[/quote]
Mine isn’t brand new, I’ve had it for about 14 months now only noticeable thing is the left trigger is a little squeaky.[/quote]
Please don’t require super-precise controls.
I hooked my Wii U Pro controller up to my computer as an xBox controller, and the setup worked perfectly. However, when I tried to use it on Roblox, I discovered that my right joystick rests ever so slightly off-center, causing my camera to turn all the time and making it impossible to play.
My point being that you probably won’t have a lot of people playing with perfect controllers. I really wish Roblox allowed you to set sensitivity settings for gamepads :([/quote]
There’s still no deadzone on those controls? I’ll talk to someone on tuesday.
Having a 0-1 range actually makes it way easier to use for inputs. For instance, if you’re using it for speed control, you can multiply your max input speed directly by this number. Learning to work with these ratios is so helpful. For instance, doing raw interpolation will return 0-1 values, which you then just manipulate easily to do what you need to do.
In response to people saying to deadzone triggers, there is no reason to, the trigger hardware is made to deadzone itself, it’s only with the toggles and joysticks that you have the deadzoning issue, because there is no feasible way to do it with hardware. If you notice, when you first start pressing on some triggers, there’s a 0.1mm gap or so before the spring is pushing against your finger, that’s a more obvious deadzone hardware feel (nicer controllers are sprung to where it’s not noticeable), and likewise, you should notice that the input will reach 1 before it’s all the way pressed down, the contact point at the end for a solid press should go straight to a metal contact, instead of a graduated resistor, old controllers should always have trigger inputs of solid 0 and 1 at their end points, and near them.
Edit: The input from Microsoft isn’t actually 256, They are just showing you that for the sake of integers, it’s actually a 0-1 float on the hardware level, and should be on the software as well
[quote] In response to people saying to deadzone triggers, there is no reason to, the trigger hardware is made to deadzone itself, it’s only with the toggles and joysticks that you have the deadzoning issue, because there is no feasible way to do it with hardware. If you notice, when you first start pressing on some triggers, there’s a 0.1mm gap or so before the spring is pushing against your finger, that’s a more obvious deadzone hardware feel (nicer controllers are sprung to where it’s not noticeable), and likewise, you should notice that the input will reach 1 before it’s all the way pressed down, the contact point at the end for a solid press should go straight to a metal contact, instead of a graduated resistor, old controllers should always have trigger inputs of solid 0 and 1 at their end points, and near them.
Edit: The input from Microsoft isn’t actually 256, They are just showing you that for the sake of integers, it’s actually a 0-1 float on the hardware level, and should be on the software as well [/quote]
The controller sitting next to me has triggers that only go to 0.94
[quote]
There’s still no deadzone on those controls? I’ll talk to someone on tuesday. [/quote]
I am very familiar with the camera controls script. There is (or was, when I last checked, but it’s not likely to have changed recently) a 0.14 deadzone on all thumbstick inputs.
[quote]
The controller sitting next to me has triggers that only go to 0.94 [/quote]
How they managed to get that wrong, I have no idea…
Image of a radial variable resistor, the end resistance is usually tuned to over that of the current, and the start is usually a copper/gold plated contact that directly connects to the source, meaning that both sides should never show any wear on them, I really do wonder what they did wrong now…
things aren’t perfect. You have a piece that’s a tiny bit shorter than it should be or a pot that’s skewed a tiny bit or the pot isn’t made perfectly and it doesn’t reach all the way to 1.
[quote]
The controller sitting next to me has triggers that only go to 0.94 [/quote]
How they managed to get that wrong, I have no idea…
Image of a radial variable resistor, the end resistance is usually tuned to over that of the current, and the start is usually a copper/gold plated contact that directly connects to the source, meaning that both sides should never show any wear on them, I really do wonder what they did wrong now…[/quote]
PS4 triggers consist of 2 V shaped springs that wrap around the hinges to provide tension along with the rubber domes which are pressed down by a bar inside the trigger. I’ve found this design to be prone to wear.