Hi, Tophat here.
I’m trying to make a humanoid look at the player, and I’m using AlignOrientation to achieve this (setting the CFrame/Orientation directly makes it stutter while walking).
Now, it somewhat works, but there’s a noticeable delay in aligning on the client, compared to the server. Below is a video of what it looks like on the client, and on the server.
I would like to replicate what the AlignOrientation is doing on the server on the client, so there is no delay.
Here is the code I’m using to create and set the attachments, constraint and their CFrames. (Server Script):
local AlignAttachment = Instance.new("Attachment")
AlignAttachment.Parent = workspace.AttachmentHolder
local AlignOrientation = Instance.new("AlignOrientation")
AlignOrientation.Parent = script.Parent.Parent.HumanoidRootPart
AlignOrientation.MaxTorque = 400000
AlignOrientation.Responsiveness = 100
AlignOrientation.Attachment0 = script.Parent.Parent.HumanoidRootPart.RootAttachment
AlignOrientation.Attachment1 = AlignAttachment
-- "RootPart" is the player character's HumanoidRootPart
AlignAttachment.CFrame = CFrame.new(script.Parent.Parent.HumanoidRootPart.Position, RootPart.Position)
while task.wait() do
AlignAttachment.CFrame = CFrame.new(script.Parent.Parent.HumanoidRootPart.Position, RootPart.Position)
end
I would greatly appreciate some help with this issue, thanks.