# How can I tell which direction as gamepad thumbstick is moved?

How can I tell if the player pushed the thumbstick up/down/left/right

1 Like

using the thumbsticks return X and Z values between -1 to 1
how would I define these values to up/down/left/right

1 Like

X is pointing to Right and -X is pointing to Left.
Y is pointing to Up and -Y is pointing to Down.

Just remember this image above^

7 Likes

If the x is 1 itâ€™s moving to the right, -1 to the left, if the z is 1 itâ€™s going forward, and -1 itâ€™s going back (I might be wrong since I donâ€™t remember). Anything in between those numbers means the pad isnâ€™t going straight in one direction.

Why do you want to know this?

2 Likes

This graph is used in mathematical functions like Sine, Tangent, etc. It is also used in the API of Roblox for certain use cases.

1 Like

I meant what is he doing in his game that heâ€™d want to know this, I thought maybe it was a specific problem, but nvm.

2 Likes

Iâ€™m creating a VR first person character â€śframeworkâ€ť and I needed to make it so the forward will always be where the player is facing

this is what I ended up doing to achieve this:
BV.Velocity = player.Character.HumanoidRootPart.CFrame:vectorToWorldSpace(Vector3.new(input.Position.X*20,0,-input.Position.Y*20))

3 Likes