Help with part Smooth Movement

Hello,

So basically, i have a script, when you click a button, it changes size with Vector 3. (That works)
But i also need it to change the position, so to go up a for a few seconds.

The current script i have is this:
goal.Position = Vector3.new(0, 8, 0)

It works, but when it does, it doesn’t go up but it goes sideways?
For goal.Size it works but Poisiton i have no idea.

Anyone know how to fix this?

1 Like

Can I see your code? Can’t exactly help without it…

local TweenService = game:GetService("TweenService")
local Model = script.Parent.Parent.Parent.Parent.Parent.Parent.Body.Pantograph.Pantograph
local Down = true
local goal = {}

script.Parent.Parent.ClickDetector.MouseClick:Connect(function()
	if Down == true then
		Down = false
		goal.Size = Vector3.new(10.938, 8, 3.732)
		goal.Position = Vector3.new(0, 8, 0)
		local tweenInfo = TweenInfo.new(3)

		local tween = TweenService:Create(Model, tweenInfo, goal)
		tween:Play()
	else
		Down = true
		goal.Size = Vector3.new(10.938, 1.939, 3.732)
		goal.Position = Vector3.new(0, -8, 0)
		local tweenInfo = TweenInfo.new(3)
		local tween = TweenService:Create(Model, tweenInfo, goal)
		tween:Play()
	end
end)
1 Like

Make it goal.Position += Vector3.new(0,8,0). That will make it go 8 studs up.

1 Like

Error:

attempt to perform arithmetic (add) on nil and Vector3

1 Like

When you set the position to 0 8 0 it moves to the position 0 8 0, not 8 studs up, so you have to change it to Model.Position+Vector3.new(0,8,0)

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