dennis Posted March 30, 2015 Share Posted March 30, 2015 Heya all, I wrote this little piece of code: i = 1000 repeat world:SetWaterHeight(i) i = i - 0.1 until i < 0.80 if i <= 0.90 then self.enabled = false self.lowerstate = false end I wanted it to lower smoothly, so you can actually see it come down. I placed this code inside Script:UpdateWorld() but my screen then stuck and the water is at the preferred height cheers Quote Link to comment Share on other sites More sharing options...
shadmar Posted March 30, 2015 Share Posted March 30, 2015 you are looping inside a loop already, so your entire loop will be done in every frame, do something like this instead (not tested) : in Start() i=1000 in UpdateWorld() if (i > 0.9) then world:SetWaterHeight(i) i=i-.1*Time:GetSpeed() --use getspeed to be fps independant. end Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
dennis Posted March 30, 2015 Author Share Posted March 30, 2015 Thanks! works fine, looks really sick Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.