Help With Tweening a Model Rotation

  • What are you attempting to achieve? (Keep it simple and clear)
    -Tween A Model’s Rotation

  • What is the issue? (Keep it simple and clear - Include screenshots/videos/GIFs if possible)
    -https://youtu.be/IwcPyVQXn5g


I want the model to Tween & face the Camera and then when it’s done the Model will Tween back.

Here’s the code

					MenuF:WaitForChild('Mission').Sound:Play()
					Cam.CFrame = workspace.Desk.CameraPart.CFrame
					Cam.CameraType = 6
					wait(8)
					for i = 180 , 0 , - 1 do
						print(i)
						workspace.Desk.NPC:SetPrimaryPartCFrame(workspace.Desk.NPC.HumanoidRootPart.CFrame * CFrame.fromEulerAnglesXYZ(0,-1,0))
						wait()
					end
2 Likes

Just add CFrame.Angles to the part you want to rotate.

Part.CFrame = CFrame.Angles(x, y, z)

For a model you would find the primary part and do the same thing.

workspace.Desk.NPC:SetPrimaryPartCFrame(CFrame.Angles(0, i, 0))

Like that?


CFrame.Angles is the same as CFrame.fromEulerAnglesXYZ

Solution


Use :SetPrimaryPartCFrame() for Positioning

if you want to Rotate a Model just Weld Everything to a Part and then Rotate that part.

You can read more here

I would highly suggest not using SetPrimaryPartCFrame. You could WeldConstraint the parts to a central part and change it’s CFrame though.

2 Likes