This is my script, which should make a wave go upwards, until it's out of a Checkbox. For some reason it doesn't register the wave colliding with the box, so the script doesn't work...
I also used a CFrame script to animate the wave. Could I make that animation more efficient in any way?
local Tsunami = script.Parent
local Checkbox1 = game.Workspace.Checkbox1
local touched = false
local StartPosition = Vector3.new(-9.841, -11.092, 675.948)
Tsunami.Touched:Connect(function(hitpart)
if hitpart == Checkbox1 then
touched = true
print("TEST-SUCCES")
while touched == true do
wait(.01)
Tsunami.CFrame = CFrame.new(StartPosition) + Vector3.new(0,15*i,0)
Tsunami.CFrame = Tsunami.CFrame * CFrame.Angles(math.rad (0), (4.71238898038), (0)); -- The wave keeps otherwise keeps facing the wrong direction
end
end
end)
