I've been struggling with this logic problem for 17 hours now in total. Finally got to solve it after intensive research. When I needed this community to help me, it did it in a blink, time to give back some love: ) So, if you're using playMaker, and the XBOX 360/One Controller is the main input device for your game, and you're wondering why you can't get the Triggers to work, this is for you. Microsoft made the Triggers to be sensible, therefore, they're Axis, not Buttons, in order to allow acceleration. ![]() Dmx controller software for mac. [Need Help] Xbox 360/PC controller Triggers. Discussion in 'Scripting' started by apiotuch, Feb 4, 2010. The problem: Even though you can get the Axis, how do you solve the acceleration? Why it starts in a already fired state? The solution: The Axis range are -1 to 1. Here lies the problem - The triggers are parked at 0 by default. From here, you can work your way to the solution, the images should be enough for a clear explanation of the logic. Notes included. Special Thanks Alex Chouls - For confirming what I was suspicious about the loop problem - slog - for pointing out the problem of the 0 start state - Other topics with the same problem. It never goes to 0 again. On the moment you start pressing the trigger, it will become the range -1 to 1. Just like a car's accelerator pedal. As you press for the first time, and keep pressing further, it will start the linear progression of the axis, -1, -0.9, -0.8. Until it reaches 1. In your example, once you release the trigger after shooting your weapon, the trigger will decrease its axis from 1 to 0.9, 0.8. Going through 0, until you fully release the trigger and it rests at -1. You can link an action to any of these values if you want, for example, so the weapon only shoots a bit late but not so late, let's say, at 0.3. Or implement an acceleration action, like stretching a bow string to shoot an arrow for example, and depending of the stretching strength, a different damage is applied. It's a very odd behavior, it should start at the range, but it starts at 0 instead, to never go to 0 again once pressed for the first time, unless you quit Unity or the Game. You can use the Controller Tester asset from the asset store to observe this behavior, it's free. If you think this is a bit complicated, wait until you have to work with the Steam Controller, which has it's triggers working as an axis and buttons at the SAME TIME. I hope the behavior is separated, and not hardcoded into a single bahavior. Word for mac 2008 check for updtes. My guess is that it will have a 'click' virtual (or maybe physical) button at the end of each range, working as a real button, to separate itself from the accelerating range behavior. If my guess is somewhat correct, then it will not be so complicated at all. So the triggers starts at 0, but when pressed it no longer will stop at 0 but actually start from -1 and go to 1, then when the trigger is let go; it goes down back to -1. Now for my game i think this will be easy. All i have to do is anything greater than, lets say 0.1 fire weapon, then anything less than 0.1 stop firing. Is this correct? Reason im asking becuase i beem trying to make the triggers work as button for a long time.
0 Comments
Leave a Reply. |