How can I change a models .LookAt CFrame?

Hello! I am DomTheMomRBLX. (Previously, DomDerpRBLX.) And, Im currently scripting a boss system for 30k robux. And I really need to fix this issue fast… How can I change the CFrame.lookAt of a Model? Because I want the model (Once in range using magnitude), to update to face the player at all times with a for loop. How can I do this to a model, though?

Make sure the model has a Primary Part assigned. Then do

Model.PrimaryPart.CFrame.LookVector = Vector3.new(player.Character.HumanoidRootPart.Position.X, 0, player.Character.HumanoidRootPart.Position.Z)

1 Like

I said this…

self.Model.PrimaryPart.CFrame = CFrame.lookAt(self.Model.PrimaryPart.Position,v.Character:WaitForChild("HumanoidRootPart").Position)

However, none of the other parts in the model follow. Only the primary part

CFrame is immutable, so that doesn’t actually work. Try putting a little more effort than just guessing.

OP just needs a PrimaryPart, yes, so you can do Model:SetPrimaryPartCFrame(CFrame.new(Model.PrimaryPart.Position, position_to_look_at))

3 Likes

Very Awesome! Thanks for the help. Could you breifly explain tweening models?