I need help with tweening

Hello. I am trying to script a spleef tile and I am stuck on some parts of the script. How would I do this properly

local TweenServ = game:GetService("TweenService")
local part = script. parent

local TweenInf1 = TweenInfo.new(
	3,
	Enum.EasingStyle.Linear,
	Enum.EasingDirection.InOut,
	0,
	true,
	0
)

local Positions = {
	Position = Vector3.new(script.Parent.Position.Y - 9.712),  -- Im having trouble here. I dont understand how I would keep all the position angles wile subtracting from only the Y position. 
}

local tween = TweenServ:Create(part, TweenInf1, Positions)

local check = true

script.Parent.Touched:Connect(function()
	if check == true then
		check = false
	end
	wait(1)
	tween:Play()
	wait(1)
	script.Parent.CanCollide = false
	script.Parent.Transparency = 0
	wait(1)
	script.Parent.CanCollide = true
	script.Parent.Transparency = 1
	script.Parent.Position = Vector3.new(script.Parent.Position.Y + 9.712)-- Im having trouble here. I dont understand how I would keep all the position angles wile subtracting from only the Y position. 
	check = true
end)






-- Y1 =  54.445 
-- Y2 = 44.733
-- Total = 9.712
1 Like

Reference it like this, Vector3 is assuming that there’s an X, Y, & Z value but instead it ended up with 1 value (Or the Y axis only):

Position = Vector3.new(script.Parent.Position.X, script.Parent.Position.Y - 9.712, script.Parent.Position.Z)
1 Like

I didnt know you were able to individualy type out the position angles and mash them together. Thank you for teaching me somthing new!

1 Like