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 » Scripters
Home Search
 

Re: Changing the CFrame of all the children in a model?

Previous Thread :: Next Thread 
drahsid5 is not online. 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 is not online. 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
AbstractMadness is not online. AbstractMadness
Joined: 22 Dec 2014
Total Posts: 20425
08 Mar 2015 02:43 PM
your code kills me
Report Abuse
drahsid5 is not online. drahsid5
Joined: 13 May 2011
Total Posts: 3937
08 Mar 2015 02:45 PM
Likely so, it's lazy code.
Report Abuse
AbstractMadness is not online. AbstractMadness
Joined: 22 Dec 2014
Total Posts: 20425
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 is not online. 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
AbstractMadness is not online. AbstractMadness
Joined: 22 Dec 2014
Total Posts: 20425
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 is not online. 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
juniorjfive is not online. juniorjfive
Joined: 05 Jan 2010
Total Posts: 671
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
juniorjfive is not online. juniorjfive
Joined: 05 Jan 2010
Total Posts: 671
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 is not online. 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
juniorjfive is not online. juniorjfive
Joined: 05 Jan 2010
Total Posts: 671
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 is not online. drahsid5
Joined: 13 May 2011
Total Posts: 3937
08 Mar 2015 03:32 PM
I know.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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