I am working in CSharp.
I am adding joystick control to my game.
As people may know the 3rd axis controls the trigger buttons on a Xbox Joystick.
A value between 0 & 1 is the right side trigger button. A value between -1 & 0 is the left side trigger button.
I wish to use the player releasing the right side trigger button as an input for the game i.e. if the 3rd axis returns a value of <1. The game should register that the player has let go of the right trigger.
The problem is that if the player uses the left trigger. It also registers as the player releasing the right trigger. Because pressing the left trigger returns a value of -1 which is also <1.
I'm assuming that I need to use a system of checking the range of the value and Boolean variables to measure whether either trigger has already been pressed. But I have no idea how to express that in code.
Any help?
Post Details
- Posted
- 7 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/Unity2D/com...