generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Water

Previous Thread :: Next Thread 
chucknorris155 is not online. chucknorris155
Joined: 03 Aug 2008
Total Posts: 4335
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
chucknorris155 is not online. chucknorris155
Joined: 03 Aug 2008
Total Posts: 4335
13 Sep 2013 04:05 PM
Any help would be appreciated
Report Abuse
chucknorris155 is not online. chucknorris155
Joined: 03 Aug 2008
Total Posts: 4335
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 is not online. 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 is online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image