How can I move a part attached to player using CFrame?

I’m trying to make a function so that player can hold, animate, or move a sign, like in the video below. I’m not sure what I should exactly do, but I know it’s something to do with CFrame. Does anybody have a suggestion on how I could do this?

By the way, the sign should originally appear on people’s back. It will be pulled to the front of the torso when players need to show their signs.

You’d need to create those specific animations that you want to happen. As for the signs, You’d need to CFrame the sign to be in front of the player, then use the CFrame.Angles function to have it rotate, you can tween it to rotate so it’s a lot smoother.

Here are a few resources:

Ok, so if I use tween, I just need to know the CFrame of the sign on the player’s back and when the sign is in front of the player?

No, You’d be tweening the rotation by using the CFrame.Angles function.

Oh, but that won’t move the sign right? If I just rotate the sign on the player’s back, then it stays behind?

Can you give me a sample code? I’ve thought of this.


for i, v in pairs (game:GetPlayers()) do 
local positionBack = v.Character.HumanoidRootPart - (the distance, I'm not sure how to use CFrame here)
local positionFront = same thing as before
local TweenInfo = tweeninfo here

Tween:play()
end 

Essentially something like this:

for i, v in pairs (game:GetPlayers()) do 
local positionBack = v.Character.HumanoidRootPart.CFrame * CFrame.New(0,0,-1) -- Change the value based on the XYZ axis to fit properly, this is psuedo code.
local positionFront = v.Character.HumanoidRootPart.CFrame * CFrame.New(0,0,1) -- read above comment
local TweenInfo = tweeninfo here

Tween:play()
end 

You’d first want to position the sign in front of the player, then do the tween.

Won’t CFrame.new represent Vector 3 of the position instead of rotation? How would I also include the rotation? I’m new to CFrame so I don’t quite get it.

CFrame is a lot more accurate in our case. For Rotation, do the following:

CFrame.Angles(90,0,0) - it will rotate 90 degrees on the X-Axis.

Can you do the changing positions and rotation at the same time using CFrame.new? If so, how?

Also when you did this:
image
What is the multiplication for?

Couldnt he just animate the sign with the player, just add the sign object into the player model, and create a custom animation, just have to add it to the rig.

Thing is I don’t want the sign to be a tool.

You can but I wouldn’t know how to, sorry. Here’s a link to math operations:

We multiply because we are getting the current position and multiplying how far we need to go.

That method doesn’t have to be tool-only. You just have to clone/create the sign and attach it to a Motor6D like the one used in the animation, then play the animation with the sign.

It’s just used for tools because its a good and easy method.

Can you tell me how it would work? Like in a sample script?

What do you mean how far you need to go? I just need to part to be rotated like in the gif above.

How far you’d like to rotate it.

I mean it doesn’t make much of a difference, it just rotates on the center point