|
| 14 Mar 2013 08:25 PM |
I have an ocean in my game, and in this ocean, there is a script to make the water appear to move.... however, after a few minutes, the ocean runs completely dry, all the water goes under the ground below it.... Then it floods.... I dont really know what the problem is, but I assumed that the mesh was moving to the -Y, the returning. My assumption also concluded that it expanded to -Y, then contracted from +Y on the return... Anyways, take a look, i want to fix it...
mesh = script.Parent.Mesh
while true do for i=25, 4, .0005 do mesh.Scale = Vector3.new(i,i,i) wait() end wait() for i=30, 2.4, -.0005 do mesh.Scale = Vector3.new(i,i,i) wait() end wait() end
|
|
|
| Report Abuse |
|
|
|
| 14 Mar 2013 08:27 PM |
Logic-wise, I'm not sure, but the step in the first for loop should be negative.
¤ ¤ † K M <( •д• )> X D † ¤ ¤ |
|
|
| Report Abuse |
|
|
|
| 14 Mar 2013 09:23 PM |
oh i see, nvm... if you have your Y values different at the start, you get some movement... it should be like this....
mesh = script.Parent.Mesh
while true do for i=25, 1, .0005 do mesh.Scale = Vector3.new(i,i,i) wait() end wait() for i=30, 1, -.0005 do mesh.Scale = Vector3.new(i,i,i) wait() end wait() end
Simplified, it means:
Look for mesh in the Parent of script
while true do: make mesh grow in X and Z values by .0005 heres the guide lines for changing the properties of mesh wait a little stop process. wait a little when mesh gets to scale 30, shrink X and Z values by -.0005 heres the guide lines for changing the properties of mesh wait a bit stop process wait a bit return to "while true do" |
|
|
| Report Abuse |
|
|
|
| 14 Mar 2013 09:30 PM |
| yeah, no, still drops... and im trying to get it to have a bit of up and down motion (+y wait{some amount of time} -Y) |
|
|
| Report Abuse |
|
|
|
| 14 Mar 2013 09:35 PM |
| well, i think i have seen the issue... what the script did is it made the mesh 29 x 29 x 29, then kept adding .0005 until it got to 30, then shrank.... any suggestions on how to fix that? |
|
|
| Report Abuse |
|
|
6dawg34
|
  |
| Joined: 31 Aug 2011 |
| Total Posts: 305 |
|
|
| 14 Mar 2013 09:43 PM |
while true do a = math.random(20,30) b = math.random(4,15) for i = 25, a,-.0005 do mesh.Scale = Vector3.new(mesh.Size.X,i,mesh.Size.Z) wait(.1) end wait() for d = a,b, -.0005 do mesh.Scale = Vector3.new(mesh.Size.X,d,mesh.Size.Z) wait(.1) end wait() end
This should work. added some cool new things to btw. |
|
|
| Report Abuse |
|
|
|
| 14 Mar 2013 09:44 PM |
| thx, ill get all over testing this pronto |
|
|
| Report Abuse |
|
|
|
| 14 Mar 2013 09:47 PM |
| haha, i forgot to mention its a SpecialMesh, anyways, ill fix the errors, they should be easy |
|
|
| Report Abuse |
|
|
|
| 14 Mar 2013 09:48 PM |
hmm, this one is puzzling though...
22:46:09.759 - Size is not a valid member of SpecialMesh |
|
|
| Report Abuse |
|
|
| |
|
6dawg34
|
  |
| Joined: 31 Aug 2011 |
| Total Posts: 305 |
|
|
| 14 Mar 2013 09:54 PM |
Ya here I fixed it.
a = math.random(20,30) while true do b = math.random(4,29) for i = a, b,-.05 do script.Parent.Scale = Vector3.new(script.Parent.Scale.X,i,script.Parent.Scale.Z) wait() end wait() for d = b,a,.05 do script.Parent.Scale = Vector3.new(script.Parent.Scale.X,d,script.Parent.Scale.Z) wait() end wait() end |
|
|
| Report Abuse |
|
|
|
| 14 Mar 2013 10:04 PM |
hmmm Scale is not a valid member of Part.... you never said Mesh, and this is what it looks like at the moment, posting errors...
mesh = script.Parent.Mesh a = math.random(20,30) while true do b = math.random(4,29) for i = a, b,-.05 do script.Parent.Scale = Vector3.new(script.Parent.Scale.X,i,script.Parent.Scale.Z) wait() end wait() for d = b,a,.05 do script.Parent.Scale = Vector3.new(script.Parent.Scale.X,d,script.Parent.Scale.Z) wait() end wait() end |
|
|
| Report Abuse |
|
|
6dawg34
|
  |
| Joined: 31 Aug 2011 |
| Total Posts: 305 |
|
| |
|
|
| 15 Mar 2013 06:51 AM |
| lol, it only goes up and down, and it looks like someone pulled the plug,, then rapidly filled it back in.... Im glad it does the up and down, kinda like the tide rolling in, but thats all there is to it. |
|
|
| Report Abuse |
|
|
|
| 15 Mar 2013 04:39 PM |
ok, now how do i get it to rise and fall between these altitudes:
High: 30.600 Low: 29.600
i know its only one stud, but thats the only margin for movement, by reason of the bottom of the boats and the floors inside them |
|
|
| Report Abuse |
|
|