Move humanoid while keeping his rotation

Hello everyone! My problem is pretty simple. I want to move humanoid using :Move() method, but at the same time I want them to keep looking at player / object. How can I achieve this?

i found the answer to this. To make humanoid keep looking at something you need to use AlignOrientation instance. Here’s code I used:

local alignOrientationInstance = Instance.new("AlignOrientation",playerPrimaryPart)
alignOrientationInstance.Mode=Enum.OrientationAlignmentMode.OneAttachment
local subjectAttachment = Instance.new("Attachment",subjectPrimaryPart)
	
alignOrientationInstance.Attachment0=subjectAttachment
alignOrientationInstance.Responsiveness=1000
alignOrientationInstance.CFrame=CFrame.Angles(0,0,0)
alignOrientationInstance.RigidityEnabled = true

subjectHumanoid:Move(direction)

RunService.Heartbeat:Connect(function()
	alignOrientationInstance.CFrame = CFrame.new(subjectPrimaryPart.Position, playerPrimaryPart.Position)
end)
--            or
RunService.RenderStepped:Connect(function()
	alignOrientationInstance.CFrame = CFrame.new(subjectPrimaryPart.Position, playerPrimaryPart.Position)
end)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.