How can I tween a part but keep its location relative to something

Basically let me just give an example of what I am trying to achieve.
I want to tween a ring to spin around the humanoidrootpart of a player. Only issue is that I want the ring to basically follow the humanoidrootpart while its spinning. How can I achieve this with tweening?

1 Like

CFrame is probably what you’re looking for.

You can learn more here:
Understanding CFrames

Here’s an example:

local root = Character.HumanoidRootPart
local orb = Orb
orb.CFrame = root.CFrame * CFrame.new(0,2,0)

In this example, the orb would move 2 studs above the HumanoidRootPart. The offset also takes orientation into account. If you don’t want that, you can instead take the position (Vector3) of the HumanoidRootPart and add an offset Vector3 to it.

I would not use tweening for ring spinning, as using a motor is more suitable and optimized while tweening costs quite a lot, especially for 3D objects. You can use a motor, set the ring’s collision to none if it’s attached somehow to the player, and to keep it on the player I’d use an invisible accessory.

I know this is an old topic, but in case you/anyone is still wondering how to do this, welds are the way to go. Just tween the C0 property to your need. This will keep the ring in the right relative position.

6 Likes