- Home /
This post has been wikified, any user with enough reputation can edit it.
Question by
SirMalarkey · Mar 16, 2013 at 04:18 AM ·
c#inputaxischaracter controller
how to get the negative of an input Axis?
im making my own custom Character Motor and i tried using this:
if (Input.GetAxis("Vertical") > 0.01f) { p_Motor.MoveForward(); }
if (Input.GetAxis("Vertical") < -0.01f) { p_Motor.MoveBack(); }
if (Input.GetAxis("Horizontal") > 0.01f) { p_Motor.MoveRight(); }
if (Input.GetAxis("Horizontal") < -0.01f) { p_Motor.MoveLeft(); }
But my character can only go forward and right, Not Back and Left. any help would be appreciated.
Malarkey
Comment
Best Answer
Answer by DaveA · Mar 16, 2013 at 04:21 AM
Try a smaller threshold, like 0, see if that works.
well hot damn that worked! so simple! Thank you, i should of tried that earlier.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Access Joystick Axis and Mouse Delta without InputManager 0 Answers
Can Input.GetAxis be used without assigning via the Input Manager? 1 Answer
C# HUD axis button display 0 Answers
Input for bluetooth controller? 0 Answers