"Merge" CFrame (Rotation + Vector3)

“Merge” CFrame (Rotation + Vector3)

Hello, I have a collection of models which work in my building system. I have one loop which constantly sets the position of the selected model to mouse.Hit.Position, I then use SetPrimaryPartCFrame on the model and use CFrame.new on my Vector3, this gives me a nicely aligned model without the complications. It also allows the welded parts of the primary part to sit nicely on it. However, when I try and add rotation to this model in a different script it breaks because CFrame.new adds a rotation value to my given Vector3.

How do I merge my Vector3 with another orientation Vector3, or have the CFrame.new exclude orientation, I don’t really understand CFrame.
Thank you for reading!

* CFrame.Angles(math.rad(90),0,0))

When you call SetPrimaryPartCFrame multiply whatever CFrame value your passing with the above to add a 90 degree rotation, change 90 to 0-360 for some other rotation, this will also work with the other 2 axis as well.

1 Like