Posted: 11th Sep 2011 18:38
I'm making a vehicle side scrolling game and I've attached the wheels to the car frame using CreateRevoluteJoint. Combining this with SetJointMotorOn (my car's the 2D equivalent of 4 wheel drive so I do this for the front and rear wheels) I can get the car moving along the terrain. However, it also causes the car to rotate and I don't know how to stop this. The rotation occurs when the car is on the ground and when it is in mid air.

I'd appreciate any clues people could give me for this.
Posted: 13th Sep 2011 2:36
I have not played with these particular commands yet.
Maybe someone who has already given them a try come in and help soon.
If not, I will play with these in the morning and see what I can come up with.
Not sure if this will be of use on my current project (an astronaut shooter) but I need to learn how to use these commmands for other games I'll b making later.

Edit
Something unexpected came up and I had to run an errand this afternoon, so I was not able to make any progress on this.
I'll try something in the morning though for sure.
Posted: 14th Sep 2011 14:32
Thanks for looking into it I'm still stumped but going to have another attempt in a little while
Posted: 14th Sep 2011 14:53
Okay, I don't know what I've done but the car sprite is no longer being rotated by the wheels
Posted: 14th Sep 2011 15:06
I now realise what I changed, I removed the motors on the Revolute joints that are holding the wheels. Instead I am now using SetSpritePhysicsTorque. However this doesn't allow me to set a maximum speed, only a force (torque) I want applied.
Posted: 14th Sep 2011 17:41
Okay, I don't know what I've done but the car sprite is no longer being rotated by the wheels

lol

I now realise what I changed, I removed the motors on the Revolute joints that are holding the wheels. Instead I am now using SetSpritePhysicsTorque. However this doesn't allow me to set a maximum speed, only a force (torque) I want applied.

Okay, it sounds like you have it under control now.
I am sorry I didn't get to it yesterday like I had said.
I'm glad you got it working on your own, and I'm sure you will get it working like you had planned if you keep trying different things.
These physics commands look awesome and will definitely make a game very dynamic.
I'll be working on something that can use these in my next project, because I want to learn how to use them all.
Posted: 14th Sep 2011 18:01
Yeah I've now worked out the the acceleration without flipping the car and braking