local LiftFloor = script.Parent.Parent.LiftFloor
local TweenService = game:GetService(“TweenService”)
local TweenStyle = TweenInfo.new(0.5, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0)
local LiftPositionUp = {CFrame = CFrame.new(-3, 17.5, 21)}
local TweenFloorUp = TweenService:Create(LiftFloor,TweenStyle,LiftPositionUp)
script.Parent.ClickDetector.MouseClick:Connect(function()
TweenFloorUp:Play()
end)
I need help with this, It’s suppose to go up but it turns invisible
Does the part teleport to the location, or just disappear? Invisible shouldn’t be possible since you aren’t tweening transparency.
The code seems to work for me!
Change some of the stuff in the code to work for yours like the parents, but here you go
local LiftFloor = script.Parent
local TweenService = game:GetService("TweenService")
local TweenStyle = TweenInfo.new(0.5, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0)
local LiftPositionUp = {CFrame = CFrame.new(-3, 17.5, 21)}
local TweenFloorUp = TweenService:Create(LiftFloor,TweenStyle,LiftPositionUp)
script.Parent.ClickDetector.MouseClick:Connect(function()
TweenFloorUp:Play()
end)
Reference the CFrame of the Object and Multiply it by a new CFrame
The use of Magic Numbers is not advised
–Magic numbers a Numbers used in Code without being clear what they are doing