Recently, I’ve been trying to rotate a part around a single point. Roblox has made it easy to do so using the code: Object.CFrame = Point * Rotation * Offset.
I’ve managed to get the part rotating around the point but I’ve also noticed that the part’s orientation turns towards the point (The same face of the part will always look at the point). Is there any way that I would the above?
Here’s a visual representation of what I would like to do:
Image 2: Using Roblox’s built-in CFrame system, the part face always looks at the other part when turning as depicted by the red arrow. The blue part’s orientation seems to be relative to the point.
Thanks for the answer. I’ve used the concept that you have suggested and made it such that the script uses CFrame to move the part instead.
Here’s what I did:
local rotation = Part.CFrame - Part.CFrame.p --This is a way of giving you the CFrame.Angles of the part since Orientation cannot directly be put with CFrame.Angles.
position = (Point * Rotation * Offset).p -- Let the game calculate out the rotation about the point and just get position of part.
Part.CFrame = CFrame.new(position) * rotation -- Fit the part's CFrame together with constant rotation.
Basically, @kingdom5’s concept was to let the game calculate out the path of the part as it moves around the point, then just take its position and keep the part’s orientation as a constant. What I did above was the same but using CFrame.