How to detect when a player turns?

Hi, I’m making a game where if a player turns, they lean towards that direction. I’m thinking it has to do with different animations for each direction, but I don’t know if it would be better to use a script to rotate the motors or something. What is the best way to do this? Thanks

What I mean:

You can get the direction the player is moving on the client. Try this line of code:

local player = game:GetService("Players")
local playerModule = require(player.PlayerScripts.PlayerModule)
local controls = playerModule:GetControls()

while task.wait() do -- for the sake of the example
    -- get the move vector
    local moveVector = controls:GetMoveVector()

    if moveVector == ... then
       -- play animation for direction here (vector3)
    elseif moveVector == ...
end
1 Like