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
 

CFrame problem

Previous Thread :: Next Thread 
Paramedic4 is not online. Paramedic4
Joined: 23 Jan 2011
Total Posts: 5934
02 Jan 2015 10:12 PM
I have this script that's supposed to rotate a part but when I rotate the model with the part and I test it, the part comes off the model, how can I fix this?

function onClick()
local part = script.Parent.Parent.Parent.part
for i = 1,100 do
part.CFrame = part.CFrame * CFrame.Angles(0,0,math.rad(0.1))
wait()
end
end
script.Parent.ClickDetector.MouseClick:connect(onClick)
Report Abuse
Paramedic4 is not online. Paramedic4
Joined: 23 Jan 2011
Total Posts: 5934
02 Jan 2015 10:25 PM
Help please?
Report Abuse
Paramedic4 is not online. Paramedic4
Joined: 23 Jan 2011
Total Posts: 5934
02 Jan 2015 10:40 PM
Anyone?
Report Abuse
Paramedic4 is not online. Paramedic4
Joined: 23 Jan 2011
Total Posts: 5934
02 Jan 2015 10:42 PM
I tried:

part.CFrame = CFrame.new(part.CFrame.lookVector) * CFrame.Angles(0,0,math.rad(0.1))

But that just made it worse, how can I fix this so that it rotates according to the objects "x" axis?
Report Abuse
lordrambo is not online. lordrambo
Joined: 16 Jun 2009
Total Posts: 20628
02 Jan 2015 10:44 PM
It's weird that it does that but get get the initial CFrame from the part's relative position from another part in the model (and acquire this before the loop starts).
Report Abuse
Paramedic4 is not online. Paramedic4
Joined: 23 Jan 2011
Total Posts: 5934
02 Jan 2015 10:47 PM
Ah ok, thanks! I managed to fix it now.
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