dsteenson
|
  |
| Joined: 05 Jul 2011 |
| Total Posts: 580 |
|
|
| 20 Jan 2013 03:17 PM |
Hey guys,
I'm not that good at scripting....at all....however I would like to control my motors better. Is there a way to make them rotate 90 degrees when you click them? I have a rough idea involving a click detector, however I don't really know the syntax.
-dsteenson |
|
|
| Report Abuse |
|
|
|
| 20 Jan 2013 05:01 PM |
ClickDetector.MouseClick:connect(function(plr) motor.CFrame = motor.CFrame * CFrame.Angles(0, 0, math.rad(90)) -- 90 degrees end)
Hope that's enough to get you started in the right direction.
Wiki Profile: http://wiki.roblox.com/index.php/User:Nelson |
|
|
| Report Abuse |
|
|
|
| 20 Jan 2013 05:24 PM |
If you mean motor as in the object Motor. All you have to do is set the desired angle to be half of pi, math.pi/2 which is 90 degrees in radians. I have a thread about more control over how it rotates and where it pivots and on what angle it pivots here... http://www.roblox.com/Forum/ShowPost.aspx?PostID=87195696 |
|
|
| Report Abuse |
|
|
dsteenson
|
  |
| Joined: 05 Jul 2011 |
| Total Posts: 580 |
|
|
| 20 Jan 2013 07:08 PM |
| You guys are awesome! I'll check this out as soon as I can. Watching the Patriots Vs Ravens now though :p |
|
|
| Report Abuse |
|
|