Organism
|
  |
| Joined: 02 Mar 2009 |
| Total Posts: 19 |
|
|
| 10 Mar 2014 10:11 PM |
Alright, I'm currently trying to get a brick to rotate on its own. I have a BodyPosition to hold it in place, BodyGyro to stabilize it when players step on it, and BodyAngularVelocity to actually rotate.
It works fine when I set it to rotate around the y axis; that is, when angular velocity is (0, 1, 0) and BodyGyro's max torque is (100, 0, 100). When I try to get it to rotate around any other axis, it doesn't work. For example, if I wanted it to rotate around the x axis I try setting angular velocity to (1, 0, 0) and BodyGyro's max torque to (0, 100, 100). It won't rotate at all in this case; the only way I can get it to rotate is by setting BodyGyro's max torque to (0, 100, 0), but that doesn't stabilize the brick. Same with the z axis.
What am I doing wrong? |
|
|
| Report Abuse |
|
|
Organism
|
  |
| Joined: 02 Mar 2009 |
| Total Posts: 19 |
|
|
| 10 Mar 2014 11:38 PM |
| I've done some research, and it may have something to do with BodyGyro's cframe. If this is the case, how would I fix it? |
|
|
| Report Abuse |
|
|
tahu157
|
  |
| Joined: 16 Nov 2008 |
| Total Posts: 15045 |
|
|
| 10 Mar 2014 11:39 PM |
BodyGyro doesn't just keep the brick level, it keeps it from rotating as well.
If you anchor the part, rotate it using the Studio's built-in rotate tool, and then unachor it, it should rotate itself back to the same orientation it was in before you rotated it. It's like a compass in that it is meant to keep your part facing a certain direction.
So, you're not doing anything wrong per se, it's just that BodyGyro is meant to keep the part from moving in the way you want it to move.
I honestly haven't done too much work with BodyGyro though, so I don't know of any workarounds off the top if my head. |
|
|
| Report Abuse |
|
|
tahu157
|
  |
| Joined: 16 Nov 2008 |
| Total Posts: 15045 |
|
|
| 10 Mar 2014 11:46 PM |
Okay, so yeah, you could probably use the BodyGyro's CFrame. You probably won't need your BodyAngularVelocity.
It'll probably take some moderate scripting and trial and error though.
You'll need a script that changes the lookvector:
http://wiki.roblox.com/index.php?title=CFrame#Properties
of the CFrame every so often. However long it takes for the part to rotate towards each lookvector. |
|
|
| Report Abuse |
|
|