Hey, I’m currently working on a flying system
local function ReturnMoveDir()
if Humanoid.MoveDirection == Vector3.new(0, 0, 0) then
return Humanoid.MoveDirection
end
local CameraCFrame = (Camera.CFrame * CFrame.new((CFrame.new(Camera.CFrame.p, Camera.CFrame.p + Vector3.new(Camera.CFrame.lookVector.x, 0, Camera.CFrame.lookVector.z)):VectorToObjectSpace(Humanoid.MoveDirection)))).p - Camera.CFrame.p;
if CameraCFrame == Vector3.new() then
return CameraCFrame
end
return CameraCFrame.unit
end
TweenService:Create(BodyVelocity, TweenInfo.new(0.3), {Velocity = ReturnMoveDir()}):Play()
Basically, I want to check when the player is going backward so I can play a different flying animation. I tried checking the Humanoid.MoveDirection and the CameraCFrame thing that’s getting returned but they’re both vector3s so the direction won’t be relative to the player. How do I check if the player is indeed flying backward?