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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Rotating A Model With A Script

Previous Thread :: Next Thread 
Drybones3363 is not online. Drybones3363
Joined: 16 Aug 2013
Total Posts: 1547
29 Nov 2013 05:24 PM
I know how to rotate a part with a script but there isn't a property for the model, how would i do it to a model?
Report Abuse
Drybones3363 is not online. Drybones3363
Joined: 16 Aug 2013
Total Posts: 1547
29 Nov 2013 05:36 PM
bump
(need an answer!!!)
Report Abuse
SuperSonic1350 is not online. SuperSonic1350
Joined: 27 Sep 2011
Total Posts: 935
29 Nov 2013 05:40 PM
You can use plugins that has those CFram things. I wish ROBLOX added properties to models so when you try to do it to one, all of its parts will not go into one area.
Report Abuse
Drybones3363 is not online. Drybones3363
Joined: 16 Aug 2013
Total Posts: 1547
29 Nov 2013 05:42 PM
sorry never heard plugins before
where would you find these?
Report Abuse
SuperSonic1350 is not online. SuperSonic1350
Joined: 27 Sep 2011
Total Posts: 935
29 Nov 2013 05:43 PM
Google it or Bing it. Its super easy to install one. Well if you know how to already.
Report Abuse
flatline115 is not online. flatline115
Joined: 29 Jul 2013
Total Posts: 7826
29 Nov 2013 05:44 PM
part = Workspace.Part
part.CFrame = part.CFrame * CFrame.Angles(math.rad(), math.rad(), math.rad())

Think of math.rad as a Circle. The entire circle is 360. If you enter math.rad(90) for example and its on the Y axis it will make a sharp twist. For more of an explanition of radians look it up on wikipedia,
Report Abuse
flatline115 is not online. flatline115
Joined: 29 Jul 2013
Total Posts: 7826
29 Nov 2013 05:48 PM
Sorry I re-read it.

Basically;

function rotate(model, angle)
for i, v in next, model:GetChildren() do
if v:IsA("BasePart") then
v.CFrame = v.CFrame * angle
end
end
end
Report Abuse
Sorexus is not online. Sorexus
Joined: 13 Aug 2013
Total Posts: 124
29 Nov 2013 05:50 PM
That would rotate the individual parts, not as a whole.
Report Abuse
flatline115 is not online. flatline115
Joined: 29 Jul 2013
Total Posts: 7826
29 Nov 2013 05:55 PM
It rotates the whole model's parts therefore.
Report Abuse
Drybones3363 is not online. Drybones3363
Joined: 16 Aug 2013
Total Posts: 1547
29 Nov 2013 06:11 PM
this?

function rotate(Ship, angle)
for i, v in next, model:GetChildren() do
if v:IsA("Ship") then
wait(3)
v.CFrame = v.CFrame * angle
end
end
end

--model name is "Ship"
--this says rotate model 5 degrees
Report Abuse
flatline115 is not online. flatline115
Joined: 29 Jul 2013
Total Posts: 7826
29 Nov 2013 06:18 PM
Nein.

function rotate(model, angle)
for i, v in next, model:GetChildren() do
if v:IsA("Ship") then
wait(3)
v.CFrame = v.CFrame * angle
end
end
end

rotate(Workspace.Ship, CFrame.Angles(math.rad(.0875), math.rad(.0875), math.rad(.0875)))
Report Abuse
Drybones3363 is not online. Drybones3363
Joined: 16 Aug 2013
Total Posts: 1547
29 Nov 2013 06:22 PM
thanks let me try it
Report Abuse
flatline115 is not online. flatline115
Joined: 29 Jul 2013
Total Posts: 7826
29 Nov 2013 06:24 PM
QQ I didn't see a change you made.

function rotate(model, angle)
for i, v in next, model:GetChildren() do
if v:IsA("BasePart") then
wait(3)
v.CFrame = v.CFrame * angle
end
end
end

rotate(Workspace.Ship, CFrame.Angles(math.rad(.0875), math.rad(.0875), math.rad(.0875)))
Report Abuse
Drybones3363 is not online. Drybones3363
Joined: 16 Aug 2013
Total Posts: 1547
29 Nov 2013 06:29 PM
it didn't rotate the model after 3 seconds
Report Abuse
flatline115 is not online. flatline115
Joined: 29 Jul 2013
Total Posts: 7826
29 Nov 2013 06:35 PM
Let me check.
Report Abuse
flatline115 is not online. flatline115
Joined: 29 Jul 2013
Total Posts: 7826
29 Nov 2013 06:37 PM
No it did but you do not realize how little 5 degrees is in radians you need a bigger number.
Report Abuse
Drybones3363 is not online. Drybones3363
Joined: 16 Aug 2013
Total Posts: 1547
29 Nov 2013 06:40 PM
i used 45 for the y instead of you numbers
Report Abuse
Drybones3363 is not online. Drybones3363
Joined: 16 Aug 2013
Total Posts: 1547
29 Nov 2013 06:50 PM
heres what i used
function rotate(model, angle)
for i, v in next, model:GetChildren() do
if v:IsA("BasePart") then
wait(3)
v.CFrame = v.CFrame * angle
end
end
end

rotate(Workspace.Ship, CFrame.Angles(math.rad(0),math.rad(45),math.rad(0)))
Report Abuse
flatline115 is not online. flatline115
Joined: 29 Jul 2013
Total Posts: 7826
29 Nov 2013 06:54 PM
I just tried it.

Do this instead though.

function rotate(model, angle)
wait(3)
for i, v in next, model:GetChildren() do
if v:IsA("BasePart") then
v.CFrame = v.CFrame * angle
end
end
end

rotate(Workspace.Ship, CFrame.Angles(math.rad(0),math.rad(45),math.rad(0)))

Also make sure Workspace.Ship exists.
Report Abuse
Drybones3363 is not online. Drybones3363
Joined: 16 Aug 2013
Total Posts: 1547
29 Nov 2013 06:59 PM
oh yeah that should work
i knoticed everything was rotating every 3 seconds
im stupid XD
Report Abuse
Drybones3363 is not online. Drybones3363
Joined: 16 Aug 2013
Total Posts: 1547
29 Nov 2013 07:08 PM
@flat
can you come to my sinking ship game and explain why what happens happens please.
I'll visit your place or something to give you an extra ticket.
Report Abuse
Jetta765214 is not online. Jetta765214
Joined: 22 Oct 2008
Total Posts: 1855
29 Nov 2013 07:12 PM
Is the problem each part is rotating around it's central axis, and not the model's central axis?
Report Abuse
flatline115 is not online. flatline115
Joined: 29 Jul 2013
Total Posts: 7826
29 Nov 2013 07:18 PM
model:GetModelCFrame()

function rotate(model, angle)
wait(3)
for i, v in next, model:GetChildren() do
if v:IsA("BasePart") then
set = model:GetModelCFrame() * angle
v.CFrame = v.CFrame * set
end
end
end

rotate(Workspace.Ship, CFrame.Angles(math.rad(0),math.rad(45),math.rad(0)))

To fix that you'd just do the above.
Report Abuse
Drybones3363 is not online. Drybones3363
Joined: 16 Aug 2013
Total Posts: 1547
29 Nov 2013 07:35 PM
that script made parts even worse.
both scripts made the whole model messed up
Report Abuse
flatline115 is not online. flatline115
Joined: 29 Jul 2013
Total Posts: 7826
29 Nov 2013 07:36 PM
Then change the Angles.
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