|
| 07 Aug 2011 10:37 PM |
| How would you steer the car? I'm not sure if I'm right or not with this, but would you need to make the lookVector of the car base the Hit of the Mouse when the MouseButton1Down event is fired, or am I wrong? |
|
|
| Report Abuse |
|
|
tofwap
|
  |
| Joined: 06 Dec 2007 |
| Total Posts: 6596 |
|
|
| 07 Aug 2011 10:41 PM |
I'm actually developing my own car right now, and I can tell you i have had the most success with a BodyAngularVelocity object,
for some reason editing RotVelocity itself causes the car to freak out, I have it set up like so:
car.BodyAngularVelocity.angularvelocity=Vector3.new(0,-0.25,0)
just need to set up the keyup function for whatever button your using as the turning key |
|
|
| Report Abuse |
|
|
|
| 07 Aug 2011 10:44 PM |
| It's the left mouse button, but how do you change the angularvelocity to where the mouse is clicked? |
|
|
| Report Abuse |
|
|
tofwap
|
  |
| Joined: 06 Dec 2007 |
| Total Posts: 6596 |
|
|
| 07 Aug 2011 10:47 PM |
I have mine set up to monitor the a and d keys, if they press one down it will turn right(d key) and left (a key). When they let the button up i simply set the rotation back to 0.
If your trying to make a car using only one button then that's going to be more tricky I would probably try a script that subtracts the rotational difference from a CFrame using the BodyGyro object. |
|
|
| Report Abuse |
|
|
|
| 07 Aug 2011 10:49 PM |
| Ohhhh that's how you're making your car. I got it. I want to make a car where it turns to where the mouse is when you click it. Do you (or anyone) know how to do that? |
|
|
| Report Abuse |
|
|
tofwap
|
  |
| Joined: 06 Dec 2007 |
| Total Posts: 6596 |
|
|
| 07 Aug 2011 10:55 PM |
I don't at the moment know if i would be able to get that working.
If i had to make one i would put a BodyGyro in the engine brick (make the body gyro only effect the Y rotation) then
BodyGyro.cframe=CFrame.new(seat position,mouseposition) |
|
|
| Report Abuse |
|
|
|
| 07 Aug 2011 11:00 PM |
| Hmmm. I think I'll try printing the Mouse's Hit property to see exactly how it works and how to apply it to the brick. Thnx fer halpin'! :3 |
|
|
| Report Abuse |
|
|