How to make a (part or character) move with a spinning part?

This may be confusing, but bare with me. So let’s say I’m on top of the spinning part. How would I make my character move with it?

Here’s some screenshots:


  1. image

  2. image

  3. image

etc…


Here is my code:

local part = script.Parent
while true do
    for i = 0,180,10 do
        part.Orientation = Vector3.new(0,i,0)
        wait()
    end
end

Thanks in advance :slight_smile: !

If you want the part to be more reliant on ROBLOX’s physics engine, then it might be best to move it with something called BodyMovers (BodyAngularVelocity, BodyPosition) instead of anchoring it and using CFrame.

If you really want to rely on CFrame, I’m pretty sure it’ll require a bit of math no matter what CFrame solution you have, but you can still take that route and alter the velocity and angular velocity of anything that touches it. You’d also need to check to make sure these objects are on top of it instead of simply touching it, just to avoid potential buggy situations.

For example, since this part is spinning, anything on top of it would move along with it, so you would use CFrame.LookVector (presumably) to constantly change velocity. Then, you’d want to change how fast this velocity is based on how far away the player is from the center, which is a bit of physics math, but not too complicated. Even after that, you’d then want to maybe make the player spin with the part, which would be even more math. While doable, all this math kind of defeats the purpose of the BodyMovers, so I won’t delve into this option unless you absolutely have to use CFrame. Let me know if this is the case and I’ll elaborate further.

If you just want to use BodyMovers, it’d be as simple as inserting a BodyPosition into the spinning part (make sure it’s unanchored and your script isn’t running), then changing the BodyPosition’s position to the wanted position, and making its force large enough to not move. Then you’d just need to add a BodyAngularVelocity and mess around with it to get it to spin the way you want.

4 Likes

What is the wanted position referring to?

By that, I meant the position of the spinning part. Since you’d have to unanchor it, you instead would need to use a BodyPosition to force it to the position you want it to be in.

1 Like

I Tried Using Those But It Didn’t Worked, I Even Tried Using a HingeConstraint, etc but none of them worked

this might be easier Documentation - Roblox Creator Hub

Yes i tried that but it didn’t work