|
| 13 Sep 2013 04:00 PM |
I am trying to male moving water that goes up and down. I got it to go up but I want it to smoothly go back down.
while true do for i = -10.2,-9,0.01 do script.Parent.CFrame = CFrame.new(script.Parent.Position.x, i, script.Parent.Position.z) wait() end end
|
|
|
| Report Abuse |
|
|
|
| 13 Sep 2013 04:05 PM |
| Any help would be appreciated |
|
|
| Report Abuse |
|
|
|
| 13 Sep 2013 04:08 PM |
nvm I fixed it like a boss
while true do if script.Parent.Position.y == -9 then for i = -9,-10.2,-0.01 do script.Parent.CFrame = CFrame.new(script.Parent.Position.x, i, script.Parent.Position.z) wait() end else for i = -10.2,-9,0.01 do script.Parent.CFrame = CFrame.new(script.Parent.Position.x, i, script.Parent.Position.z) wait() end end end |
|
|
| Report Abuse |
|
|
Soquick
|
  |
| Joined: 01 Nov 2012 |
| Total Posts: 1497 |
|
|
| 13 Sep 2013 04:08 PM |
while true do for i = -10.2,-9,0.01 do script.Parent.CFrame = CFrame.new(script.Parent.Position.x, i, script.Parent.Position.z) wait() end for i = -10.2,-9,0.01 do script.Parent.CFrame = CFrame.new(script.Parent.Position.x, -i, script.Parent.Position.z) wait() end end Try that? |
|
|
| Report Abuse |
|
|
As8D
|
  |
| Joined: 24 Dec 2009 |
| Total Posts: 2907 |
|
|
| 13 Sep 2013 04:10 PM |
Hello.
Heard of sinus and/or cosinus?
I like them when making moving stuff. Smoothiness.
ex:
game:service("RunService").Stepped:connect(function(currTime, step) -- for UBER SMOOTHNESS! part.Mesh.Scale = Vector3.new(1, 1.5 + math.sin(currTime / 10) * 0.5, 1) end)
Change the 10 and 0.5 to your liking. lowering 10 will make it go faster up and down, while changing 0.5 will change how far it will go up and down.
- As, remember to define part though. Or something else. Or my brain. Or the world. YAY! |
|
|
| Report Abuse |
|
|