본문 바로가기

Roblox

[Roblox] 닿으면 페이드되는 파트 (Parts that fade when touched)

-- Workspace - Part - Script
local platform = script.Parent
local isTouched = false
local function fade()
if not isTouched then
isTouched = true
for count = 1, 10 do
platform.Transparency = count / 10
wait(0.1)
end
platform.CanCollide = false
wait(3)
platform.CanCollide = true
platform.Transparency = 0
isTouched = false
end
end
platform.Touched:Connect(fade)

Reference : https://developer.roblox.com/en-us/onboarding/fading-trap/2