Tween CFrame Rotation not working

I’ve been cursing my screen for the last hour because I have no idea why this is happening, I’m pretty sure it’s a small detail, but I can’t find it :disappointed_relieved:

--Full code
local TweenService = game:GetService("TweenService")

local Waypoints = game.Workspace.Waypoints

local Root = script.Parent.HumanoidRootPart

for Number = 1, #Waypoints:GetChildren() do
	local Waypoint = Waypoints[Number]
	
	local Distance = (Root.Position - Waypoint.Position).Magnitude
	local Velocity = 2.5
	
	local MoveToInfo = TweenInfo.new(Distance/Velocity, Enum.EasingStyle.Linear)
	local RotateInfo = TweenInfo.new(0.25, Enum.EasingStyle.Linear)
	
	local MoveTo = TweenService:Create(Root, MoveToInfo, {CFrame = CFrame.new(Waypoint.Position)})
	MoveTo:Play()
	
	MoveTo.Completed:Wait()
	
	local Rotate = TweenService:Create(Root, RotateInfo, {CFrame = CFrame.Angles(math.rad(Waypoint.Orientation.X), math.rad(Waypoint.Orientation.Y), math.rad(Waypoint.Orientation.Z))})
	Rotate:Play()
	
end
----

Video:


(the video is short because devforum doesn’t support larger videos)

what I am trying to do is that the red dude when he reaches the waypoint (when the tween is completed) rotate to the direction the waypoint is, but still moving, just rotate

This silly-faced little red dumb just won’t rotateee

I really appreciate any help :wink:

1 Like

Try .Orientation as Tween Goal or test the CFrames Vectors

1 Like

You need to do CFrame = Root.CFrame * CFrame.Angles(…)

1 Like

Is the same thing, I tried it and doesn’t work.

1 Like

It doesn’t work, what it does is rotate only the Root/HumanoidRootPart and the whole body stays the same and makes it spin in a weird way

Why did you put waypoint.Orientation in CFrame.Angles? It doesnt’t rotate the root part properly. Try to put CFrame = waypoint.CFrame in Rotate Goal table.

The character still doesn’t rotate.
I put the orientation in cframe.angles because I want it to rotate in 0.25 seconds and if I put the position too, it won’t move while rotating

Does every waypoint rotated to right direction? (Looking to the next waypoint)

Thereㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ

Try to add Rotate.Completed:Wait() and put CFrame = Waypoint.CFrame in Rotate

But I don’t want to add the :Wait() to the Rotate Tween because I don’t want it to stop for a short time when reaching a waypoint, I want it to be fluid, I’m doing a tower defense and I don’t want that to happen.
By the way, thank you very much for helping :blush:, I don’t want you to think that I’m not trying to solve it. I appreciate it

You can’t rotate it without wait() because every new MoveTo stops tweening cframe’s lookAt and tween only position

trueee you’re right! But how do I do so that it does not stop and rotate?

Have you tried model:PivotTo(CFrame)?

But I can’t tween that, right?