Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How Can I Detect Mobile Thumbstick Direction?

Asked by 3 years ago

I have a script that can detect mobile thumbstick but since it's MoveDirection it doesn't account for the camera. So it when it prints the MoveDirection the result doesn't have a y direction in the Vector3. Here is the code.

local player = game.Players.LocalPlayer
local Character = player.Character
local Seat = game.Workspace.Seat
local UIS = game:GetService("UserInputService")


Character.Humanoid.Changed:Connect(function(Prop)
    if Prop == "MoveDirection" then
        Seat.CFrame = Seat.CFrame + Character.Humanoid.MoveDirection
        print("Move")
        print(Character.Humanoid.MoveDirection)
    end

end)

Is there some math i can do to get the Y as well, or is there a better way to get the Mobile Thumbstick Direction?

Answer this question