I tried rotating a part that is affected by aweld but it didnt work.

Here is my script :

local weldPos = 0
local rot = 0
for i=1,6 do
	weldPos = weldPos - 0.035
	rot = rot - 15
	weld.C0 = circle.CFrame:inverse() * player.Character.HumanoidRootPart.CFrame * CFrame.new(0,0,weldPos):inverse() * CFrame.Angles(math.rad(0), math.rad(0), math.rad(rot)) -- Everything except the CFrame.Angles work. I just cant find a way to rotate the part
	wait()
end

Here are the weld properties :

local circle = game.Workspace.Part
weld.Part0 = circle
weld.Part1 = player.Character.HumanoidRootPart
weld.C0 = circle.CFrame:inverse() * player.Character.HumanoidRootPart.CFrame * CFrame.new(1.35,1.50,-2):inverse()

As you can see, i want to rotate the circle, even though he's using a weld, but it doest work

Gif of what is happening : https://gfycat.com/ObviousYearlyGraysquirrel (Normally, the square is in front of the player's hand, but with the CFrame.Angles, it's not the same thing)

9 comments

0

can you include a gif/img of what is happening?

0

I added one

0

If it had worked, the square would have rotated without moving

0

Should you not be using the players right arm CFrame and not the roop part?

0

If i used the arm cframe, it don't always spawn in front of the player, sometimes to the left or to the right.... it's very randomly

0

Also, when i use the Right upper arm cframe, the square is up the arm, facing the sky (and i dont know how to rotate it, that's why i asked this question)

0

I think this is causd by the parts rotation. I would have the part setup like https://gyazo.com/cf3f5ea6ec7a36f10a1e8dd4c4ec5b51

0

Then apply any CFrame logic from that with the roation of the part being last.