Reputation: 61
I have a problem with my Bike in Box2d. It`s done with a revolute joint.
When I want to climb a hill in my game with this Bike, it always spins arround and fall down. I have tested different physical settings, and if the torque is too high it also spins, but I think there is any solution outthere but I don´t find anything that helps me.
And is there a solution to start my bike immediatly instead of waiting until the "motor" is at full speed? For example on a gradient of a hill in my game.
please help me :)
Upvotes: 0
Views: 449
Reputation: 1419
If you are using only revolute joint in your case then you must use prismatic joint also to create the shocker effect... This proamatic joint axis should be set to make the bike table probably towards the centre of the chasis... Also you cannot create revolute and prismatic joint at the same point it you must use a temp body between them.....
What you can do is instead of creating prismatic joint and revolute joint create a single wheel joint that will serve your purpose it has both the effect of revolute and prismatic joint..
Also if you have implemnted all of this above and getting the same result then post you code of the values that you have set to all the joint and bodies corresponding to the bike... Then this would be the problem due to wrong values resulting in unstable bike
Upvotes: 0
Reputation: 2305
Use this video to get the idea on how to make joints
Basically instead of revolute joint you must use wheel joint
But in wheel joint u cant set the limit of sprigness so you have to use a rope joint to have a limit
http://www.youtube.com/watch?v=bBIXpu-D_Zo
Upvotes: 0