I’m currently scripting a vehicle to support mobile thumbstick input in addition to keyboard input. To do this, I used the :GetMoveVector() function from the player control script to map thumbstick input to one of four directions:
--assume this is all within a RenderStepped function
local MoveVector = Control:GetMoveVector()
if MoveVector ~= Vector3.new(0, 0, 0) then
if MoveVector.Z >= -1 and MoveVector.Z < 0 then
print("Forward")
elseif MoveVector.Z > 0 then
print ("Back")
elseif MoveVector.X >= -1 and MoveVector.X < 0 then
print("Left")
elseif MoveVector.X > 0 then
print ("Right")
end
end
Although this script functions as intended for the dynamic thumbstick, it doesn’t seem to work properly with the legacy thumbstick. These are the values :GetMoveVector() returns when I move forward ingame:
Dynamic thumbstick
Computer keyboard
Legacy thumbstick
Curiously, the legacy thumbstick returns movement vectors with absolute values greater than 1. This is the same case for every other direction. I’m at a bit of a loss here because this issue is unique to the legacy thumbstick. How can I get this script to map inputs from the legacy thumbstick without sacrificing support for keyboards/the dynamic thumbstick?