How can I make a Model move using tween?

  1. What do you want to achieve? I want to make a Model move using tween

  2. What is the issue? After I followed this video step by step only the root part moved.
    Here is the video: How to Animate Models - Roblox Studio - YouTube

  3. What solutions have you tried so far? Youtube


 
local model = script.Parent
local root = model:WaitForChild("Root")
local tweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(
	1, --Time it takes to complete
	Enum.EasingStyle.Sine, -- Style to tween
	Enum.EasingDirection.In, --In is default, out is reverse, inOut is in first then out  
	-1, -- Times to repeat (-1 is infinite)
	true, --Does it repeat?
	1 --Time between tweens (if it repeats) 
)
local properties = { --Put as many properties as you want 
	Position = Vector3.new(0, 10, 0) 
	--(only properties that should be used are Position, Orientation, and CFrame, since we are tweening the Root)
}

local tween = tweenService:Create(root, tweenInfo, properties)
tween:Play()

If it’s not a single object and rather a model, you can use the PrimaryPart property of the model. If it’s for a player’s character, I wouldn’t recommend that has the movement isn’t smooth at all.

1 Like

I will try it out but where is o,t,l,s,d defined to what its supposed to do?

This part under where I wrote “Usage”. I also provided an example use case.

I think this thread can help with what you need. It has a full in-depth guide on tweening models, so a full read through of it could be really helpful for you.

I usually Weld the whole model together to the primary part. Then you gotta unanchor the welded parts, to make them move with the primary part.

1 Like