drahsid5
|
  |
| Joined: 13 May 2011 |
| Total Posts: 3937 |
|
|
| 08 Mar 2015 02:34 PM |
Sometimes I suck, The grass won't move.
while wait(1/60) do for i=1, 10 do script.Parent.TerrainGen.Nature.Vegitation:GetChildren().CFrame = script.Parent.TerrainGen.Nature.Vegitation.Grass.CFrame*CFrame.new()*CFrame.Angles(0.005,0,.015) game:service'RunService'.RenderStepped:wait(.02) end for i=1, 20 do script.Parent.TerrainGen.Nature.Vegitation:GetChildren().CFrame = script.Parent.TerrainGen.Nature.Vegitation.Grass.CFrame*CFrame.new()*CFrame.Angles(0.005,0,.015) game:service'RunService'.RenderStepped:wait(.02) end for i=1, 10 do script.Parent.TerrainGen.Nature.Vegitation:GetChildren().CFrame = script.Parent.TerrainGen.Nature.Vegitation.Grass.CFrame*CFrame.new()*CFrame.Angles(0.005,0,.015) game:service'RunService'.RenderStepped:wait(.02) end end
|
|
|
| Report Abuse |
|
|
drahsid5
|
  |
| Joined: 13 May 2011 |
| Total Posts: 3937 |
|
|
| 08 Mar 2015 02:39 PM |
| just noticed I was using renderstepped in a non local script, I changed it to wait, still doesn't work. |
|
|
| Report Abuse |
|
|
| |
|
drahsid5
|
  |
| Joined: 13 May 2011 |
| Total Posts: 3937 |
|
|
| 08 Mar 2015 02:45 PM |
| Likely so, it's lazy code. |
|
|
| Report Abuse |
|
|
|
| 08 Mar 2015 02:50 PM |
anyways, here is some stuff you need:
http://wiki.roblox.com/index.php?title=API:Class/Model/PrimaryPart |
|
|
| Report Abuse |
|
|
drahsid5
|
  |
| Joined: 13 May 2011 |
| Total Posts: 3937 |
|
|
| 08 Mar 2015 02:54 PM |
Would that work? I'm trying to make waving grass.
|
|
|
| Report Abuse |
|
|
|
| 08 Mar 2015 02:55 PM |
| If you wanted to group all of the grass and move it at the same time, yes. |
|
|
| Report Abuse |
|
|
drahsid5
|
  |
| Joined: 13 May 2011 |
| Total Posts: 3937 |
|
|
| 08 Mar 2015 02:59 PM |
It's still not working?
script.Parent.TerrainGen.Nature.Vegitation.PrimaryPart = script.Parent.TerrainGen.Nature.Vegitation.Grass while wait(1/60) do for i=1, 10 do script.Parent.TerrainGen.Nature.Vegitation.PrimaryPart.CFrame = script.Parent.TerrainGen.Nature.Vegitation.PrimaryPart.CFrame*CFrame.new()*CFrame.Angles(0.005,0,.015) wait(.02) end for i=1, 20 do script.Parent.TerrainGen.Nature.Vegitation.PrimaryPart.CFrame = script.Parent.TerrainGen.Nature.Vegitation.PrimaryPart.CFrame*CFrame.new()*CFrame.Angles(0.005,0,.015) wait(.02) end for i=1, 10 do script.Parent.TerrainGen.Nature.Vegitation.PrimaryPart.CFrame = script.Parent.TerrainGen.Nature.Vegitation.PrimaryPart.CFrame*CFrame.new()*CFrame.Angles(0.005,0,.015) wait(.02) end end |
|
|
| Report Abuse |
|
|
|
| 08 Mar 2015 03:09 PM |
local GrassModel = script.Parent.TerrainGen.Nature.Vegitation local PrimaryCFrame = { }
for index, grass in next, GrassModel:GetChildren() do -- Set the grass' Originated CFrame PrimaryCFrame[ index ] = grass.CFrame end
for time = 0, 1, 1/10 do for index, grass in next, GrassModel:GetChildren() do -- Animate the grass grass.CFrame = PrimaryCFrame[ index ] * CFrame.Angles(.005, 0, .015) end wait(1/30) end |
|
|
| Report Abuse |
|
|
|
| 08 Mar 2015 03:15 PM |
Forgot to multiply the movement by the "time"..
for time = 0, 1, 1/60 do for index, grass in next, GrassModel:GetChildren() do -- Animate the grass grass.CFrame = PrimaryCFrame[ index ] * CFrame.Angles(time * .05, 0, time * .015) end wait(1/30) end |
|
|
| Report Abuse |
|
|
drahsid5
|
  |
| Joined: 13 May 2011 |
| Total Posts: 3937 |
|
|
| 08 Mar 2015 03:29 PM |
| That worked, but it keeps going in a single direction. |
|
|
| Report Abuse |
|
|
|
| 08 Mar 2015 03:30 PM |
What do you mean, "single direction"?
Just make another loop to make it go another direction.. |
|
|
| Report Abuse |
|
|
drahsid5
|
  |
| Joined: 13 May 2011 |
| Total Posts: 3937 |
|
| |
|