Tween doesn't work, while Lerp works just fine

I have a model that I need moved/rotated smoothly, I can achieve this with Tween Service. However, when I play the tween the model does nothing. I am tweening the root part which is the primary part of the model, and the rest of the model is welded or connected to the root with a motor6d.

Code with tween service (doesn’t do anything):

local lookAt = Vector3.new(nearestPlayer.HumanoidRootPart.Position.X, self.model.HumanoidRootPart.Position.Y, nearestPlayer.HumanoidRootPart.Position.Z)
TweenService:Create(self.model.HumanoidRootPart, TweenInfo.new(0.25), {CFrame = CFrame.new(self.model.HumanoidRootPart.Position, lookAt)}):Play()

Code with Lerp (works right):

local lookAt = Vector3.new(nearestPlayer.HumanoidRootPart.Position.X, self.model.HumanoidRootPart.Position.Y, nearestPlayer.HumanoidRootPart.Position.Z)
self.model.HumanoidRootPart.CFrame = self.model.HumanoidRootPart.CFrame:Lerp(CFrame.new(self.model.HumanoidRootPart.Position, lookAt), 0.5)

The model did actually rotate until I ungrouped the model and grouped it again, only thing that changed in the new group is Scaling became 1 unlike 0.019 which it was before. Still no reason for Tween not to work.

Genuinely so confused.

…did you make sure to play the tween?

Yeah, its in the code above. I play it right after I create it

2 Likes

I tested both versions myself, and they both work. I ran into a possible issue myself, which was that the HumanoidRootPart was anchored, which caused it to only move with the Lerp function. However, once you unanchor the root part, the tween works fine, client and server side.

The code works fine. If I had to guess, you probably have some weird gimmick concerning the model you are rotating. I recommend you check all the physical properties of everything.

1 Like

You were right, for some reason the part welded to the root part had a bigger mass than the root part so the root part wouldn’t move. Made the part massless now it works. Weird nonetheless though.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.