I made this script that should make a wave go up, until a certain height. I succeeded in making the wave stop going up within the i-loop, but it makes the entire wave stop. I would like it to keep moving in the X-direction. How do i make sure the CFrame.X doesn't stop?
local Tsunami = script.Parent
local MaxHeigth = 44
local StartPosition = Vector3.new(-0.231, -76, 1016.603)
for i = 1,1000 do
wait(.01)
Tsunami.CFrame = CFrame.new(StartPosition) + Vector3.new(0,0,i*-5) + Vector3.new(0,i,0)
if Tsunami.CFrame.Y == MaxHeigth then
Tsunami.CFrame.Y = MaxHeigth
Tsunami.CFrame.X = i*-5
end
end

4 comments
Aha, thank you. Haven't even heard of Tweenservice before...
No problem. Glad to help.
This script gives me just 1 problem: with the CFrames the wave would just go through colliding parts, like the ground. However with the Tweening, it acts like it collides with the ground...
Just make the wave non-collidable through properties. Set CanCollide to false.