[REPOST] Help with spring pad

So I want to make a spring pad that when you step on it then it will close inward.
Ex:
image

And if you step off it will open upwards
Ex:
image

Spring pad testing.rbxl (94.6 KB)

roblox springs and collisions seem to be quite buggy from my experience, you will be better off adding this function in a script.

1 Like

So just normally tweening it?

extra text…

2 Likes

local tweenService = game:GetService(“TweenService”)
local tweenInfo = tweenService.New(1)
part = “your button here”
local storedPos = part.Position
local inTween = nil
local outTween = nil

part.Touched:Connect(function(b)
if b.Parent:FindFirstChild(“Humanoid”) then
if outTween ~= nil then
outTween:Stop()
end
local vector = part.Position - vector3.new(0,-1,0)
inTween = tweenService:Create(part, tweenInfo,{Position = vector})
imTween:Play()
end
end)

part.TouchEnded:Connect(function(b)
if b.Parent:FindFirstChild(“Humanoid”) then
if inTween ~= nil then
inTween:Stop()
end
local vector = storedPos
outTweenService:Create(part, tweenInfo,{Position = vector})
outTween:Play()

you might have to change some this, i wrote this on mobile