New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
Still have questions? Join our Discord server and get real time help.
Log in to vote

How to rotate a model to face a position?

Asked by 4 months ago

So I wanna rotate a part of a model to face the position of another part. I have tried the following script, but it always return the error Argument 1 missing or nil..

How would I go about fixing this?

Here's the line of code I have that's suposed to rotate it:

script.Parent.Top:SetPrimaryPartCFrame(script.Parent.Top.PrimaryPart.Position, game.Workspace:FindFirstChild(Target).HumanoidRootPart.Position)

Note: "game.Workspace:FindFirstChild(Target).HumanoidRootPart.Position" is the position the model is supposed to look at.

Any help is appreciated!


Target is nil kingdom5 5506 — 4mo
Look at the wiki here: What you want is the 2nd, or CFrame.fromMatrix dualworlds 90 — 4mo
The wiki explains nothing good about how to use that CFrame.fromMatrix bruh wilsonsilva007 354 — 4mo

Answer this question