you can do something like this for alignorientation
local runService = game:GetService("RunService")
local character = script.Parent
local rootPart = character:WaitForChild("HumanoidRootPart")
local alignOrientation = script:WaitForChild("AlignOrientation")
alignOrientation.Attachment0 = rootPart:WaitForChild("RootRigAttachment")
-- every frame update the alignOrientation to rotate in the direction the character is moving
runService.Heartbeat:Connect(function(deltaTime)
alignOrientation.CFrame = CFrame.lookat(Vector3.zero, rootPart.AssemblyLinearVelocity)
end)
local runService = game:GetService("RunService")
local character = script.Parent
local rootPart = character:WaitForChild("HumanoidRootPart")
local alignOrientation = Instance.new("AlignOrientation")
alginOrientation.Parent = script
alignOrientation.Attachment0 = rootPart:WaitForChild("RootRigAttachment")
-- every frame update the alignOrientation to rotate in the direction the character is moving
runService.Heartbeat:Connect(function(deltaTime)
alignOrientation.CFrame = CFrame.lookat(Vector3.zero, rootPart.AssemblyLinearVelocity)
end)