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: Okay, I give up

Previous Thread :: Next Thread 
janthran is not online. janthran
Joined: 15 May 2009
Total Posts: 17429
13 Sep 2013 02:06 PM
I've spent like the last hour scouring free models for a function to rotate a model. How do I do it with minimal lines of code? :/
Report Abuse
janthran is not online. janthran
Joined: 15 May 2009
Total Posts: 17429
13 Sep 2013 02:28 PM
Anyone? Please?
Report Abuse
unholysoda is not online. unholysoda
Joined: 15 May 2010
Total Posts: 9024
13 Sep 2013 02:35 PM
http://www.roblox.com/Rotate-Model-Function-item?id=58293017
Report Abuse
janthran is not online. janthran
Joined: 15 May 2009
Total Posts: 17429
13 Sep 2013 03:13 PM
Thanks.
Follow-up question: Is there a way to do GetChildren recursively?
Like getchildren of a model in a model?
Report Abuse
janthran is not online. janthran
Joined: 15 May 2009
Total Posts: 17429
13 Sep 2013 03:27 PM
So I have this

tm=script.Parent


function rotatemodel(model,center,rotation)
for i,v in ipairs(model:GetChildren()) do
if v:IsA("Basepart") then
v.CFrame=((CFrame.new(center)*rotation)*CFrame.new((v.Position-center)))*(v.CFrame-v.Position)
elseif v:IsA("Model") then
kids=v:GetChildren()
rotatemodel(kids,tm.PivotPoint.Position,CFrame.Angles(math.pi/2,0,0)) end
end
end

rotatemodel(tm,tm.PivotPoint.Position,CFrame.Angles(math.pi/2,0,0))

Stack ending on line 8 with
>Attempt to call global method "GetChildren" (A nil value)

or something like that. I closed the window
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