Can"t tween a Model

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? I want to tween a anchored model named Ufo to a random Position

  2. What is the issue The tween ain’t tweening (It"s not moving)

  3. What solutions have you tried so far? I have tried moving the primary part but the ufo doesn’t move with it even when welded

local islandPos = game.Workspace.IslandPositions:GetChildren()
local ufo = script.Parent

local TweenService = game:GetService("TweenService")
local info = TweenInfo.new(4, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false)

while wait(4) do
	local randomPos = islandPos[math.random(1, #islandPos)]
	local newPos = {Position = Vector3.new(7.5, 251.25, -40.75)}
	local tween = TweenService:Create(ufo, info, newPos)

	tween:Play()
end

Tweening a model is a bit of a tricky one. You have 2 main options:

  1. (easiest) Weld all the model parts to the primary part and unanchor all parts except the primary part, then tween the primary part’s CFrame.

  2. Use a loop and TweenService’s :GetValue method to build your own tween operation. You can then apply the result number of GetValue to CFrame:Lerp(), then pass the result to the model’s :PivotTo() function.

1 Like

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