x


Analog stick control

Correct me if I'm wrong but Input.GetAxis() only returns -1, 0, or 1. I was hoping it would return .5 if the analog stick was tilted halfway in the positive direction.

In most games with analog controls you tilt the stick slightly to make the character walk and you tilt the stick all the way to make the character run.

Is there a way to find out how much the analog stick was tilted? Or is there some other way to get analog controls working?

more ▼

asked Dec 20 '10 at 01:55 AM

ronin sixshooter gravatar image

ronin sixshooter
187 16 16 23

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

I was hoping it would return .5 if the analog stick was tilted halfway in the positive direction.

That is what it does. Like the docs say: "The value will be in the range -1...1 for keyboard and joystick input."

more ▼

answered Dec 20 '10 at 02:05 AM

Eric5h5 gravatar image

Eric5h5
80.1k 41 132 519

Oh ok. Thanks I got it to work. I figured out that the Dead setting in the Input manager was set to 1. So its the Dead setting that was the problem.

Dec 20 '10 at 02:28 AM ronin sixshooter
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x949
x519
x214
x14

asked: Dec 20 '10 at 01:55 AM

Seen: 2019 times

Last Updated: Dec 20 '10 at 01:55 AM