|
| 14 Jun 2013 07:33 PM |
I want "grass" to rotate around the Y-axis, basically exactly the same way a carousel would rotate around its axis. However this isnt doing the trick.
local ryr = math.random(-180,180) grass.CFrame = CFrame.fromEulerAnglesXYZ(grass.CFrame.x, ryr, grass.CFrame.z) |
|
|
| Report Abuse |
|
|
|
| 14 Jun 2013 07:34 PM |
grass.CFrame = grass.CFrame * CFrame.Angles(0,ryr,0)
|
|
|
| Report Abuse |
|
|
|
| 14 Jun 2013 07:36 PM |
| grass.CFrame = grass.CFrame * CFrame.Angles(0, math.rad(ryr), 0) |
|
|
| Report Abuse |
|
|
|
| 14 Jun 2013 07:36 PM |
If your talking about it going around and around and that this is in a loop then.....
local ryr = Instance.new("IntValue",game.Workspace) grass.CFrame = CFrame.fromEulerAnglesXYZ(grass.CFrame.x, math.rad(ryr.Value+1), grass.CFrame.z)
But if you want what you just gave me then Ima guess...
local ryr = math.random(-180,180) grass.CFrame = CFrame.fromEulerAnglesXYZ(grass.CFrame.x, math.rad(ryr), grass.CFrame.z) |
|
|
| Report Abuse |
|
|
|
| 14 Jun 2013 07:36 PM |
Still no.
Look, they are rotating around x and z axis weirdly,
puu.sh/3fUar.jpg
I want them to rotate on the same axis as a carousel would.
By the way that huge sphere is the bottom of the grass mesh |
|
|
| Report Abuse |
|
|
|
| 14 Jun 2013 07:37 PM |
| Are you replying to me because I made my post like a few seconds before yours. |
|
|
| Report Abuse |
|
|
|
| 14 Jun 2013 07:39 PM |
To cody, but your line did this: puu.sh/3fUgq.jpg
see that grass ball below the baseplate?
its a huge rotating ball of grass that should be on the plate xD |
|
|
| Report Abuse |
|
|
|
| 14 Jun 2013 07:41 PM |
Okay, put the CFrame to what you want:
local Part = Game.Workspace.Grass local Cframe = CFrame.new(0, 0, 0)
for i = 1, 360 do Part.CFrame = Cframe * CFrame.Angles(0, math.rad(i), 0) end
And you could loop that if you want. |
|
|
| Report Abuse |
|
|
|
| 14 Jun 2013 07:42 PM |
This is basically the grass I want to rotate. puu.sh/3fUm5.jpg
but with cody's line, it looks like this: http://puu.sh/3fUar
with evolveds line like this: http://puu.sh/3fUgq |
|
|
| Report Abuse |
|
|
|
| 14 Jun 2013 07:44 PM |
| And its not in a loop it will only be positioned once |
|
|
| Report Abuse |
|
|
|
| 14 Jun 2013 07:45 PM |
for _, Grass in pairs(Game.Workspace:GetChildren()) do if Grass.Name == "Grass" then Grass.CFrame = Grass.CFrame * CFrame.Angles(0, math.rad(math.rad(-180, 180), 0) end end |
|
|
| Report Abuse |
|
|
|
| 14 Jun 2013 07:46 PM |
CFrame.Angles(0, math.rad(math.rad(-180, 180), 0) to CFrame.Angles(0, math.rad(math.random(-180, 180)), 0) |
|
|
| Report Abuse |
|
|
| |
|