Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How do I rotate a model towards a CFrame?

Asked by 6 years ago

I don't need any links to the wiki about CFrames. I have a model and I need to rotate it towards a CFrame. How would I do that?

CFrames are very confusing to me. I understand the concept of them, and that they make up the rotation matrix or whatnot.

1 answer

Log in to vote
0
Answered by
2eggnog 981 Moderation Voter
6 years ago
Edited 6 years ago

The easiest way to do this is to give the model a primary part (preferably one right at the center) and use Model.SetPrimaryPartCFrame method. This will move/rotate all the parts in the model with it. Example:

PointToFaceTowards = Vector3.new(100, 200, 300)
Model:SetPrimaryPartCFrame(CFrame.new(Model.PrimaryPart.Position, PointToFaceTowards))
0
This should help, thanks. Jesse1240 59 — 6y
Ad

Answer this question