I want to make it so when you press a button, the model will go to the location specified.
I don’t know how to make models tween, this is my current code:
local clickDetector = script.Parent
local model = workspace.billboard
local tweens = game:GetService(“TweenService”)
local info = TweenInfo.new(2, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 1, true)
local pos = model.Position - Vector3.new(0,10,0)
local tween = tweens:Create(model, info, {Position = pos})
local function onClicked(player)
tween:Play()
end
The reverse property on your tween is set to true, paste this script instead:
local model = workspace.billboard
local tweens = game:GetService(“TweenService”)
local info = TweenInfo.new(2, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false)
local pos = model.Position - Vector3.new(0,10,0)
local tween = tweens:Create(model, info, {Position = pos})
local function onClicked(player)
tween:Play()
end
clickDetector.MouseClick:Connect(onClicked)
make sure to modify the script in order to tween the single part instead of the model