So I am adding a rolling feature to my game. Ik how to do the animation part but do not not how to make the player move in the direction they are facing. help
Here is my animation script:
local UIS = game:GetService('UserInputService') local Anim = script.Parent:WaitForChild('RollAnim') UIS.InputBegan:Connect(function(input) if input.KeyCode == Enum.KeyCode.R then local Animation = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(Anim) Animation:Play() end end)
What you're looking for is called LookVector
.
The forward-direction component of the CFrame’s orientation. Equivalent to: Vector3.new(-r02, -r12, -r22)
You could make the player move by doing:
player.CFrame += player.CFrame.LookVector*studs