I have a side scrolling car game (think of those sidescrolling motorbike games, etc) where the car has to run some kind of obstacle course. Unlike the motorcycle games, you don't control these cars directly. They are built from a body and two wheels, each wheel has a motor (a revolute joint) in the middle. The wheel's friction setting is set to 1, and the ground's friction is 1 as well. Increasing friction and density does not help... And yet there is always that one time when a wheel gets stuck in a rut and it cannot seem to grip the ground, so the wheel keep spinning but the car does not move. Is there any setting or any other way to increase this kind of traction and grip?
I'd optimally even want the cars to climb up a 45 degree slope. How might I accomplish this? I'll need the cars to "stick" to the ground a little bit... As if the wheels had velcro on them.
Thanks.
I have the same problem, but nobody seems to have the solution.
Any success so far?
I haven't had success with this either. Increasing friction beyond 1 does not help either. Did anyone figure this out?
I haven't tried this before, but I can't see why it wouldn't work...
Try applying force on the center of each wheel, perpendicular to the ground. You can do this when the ground's angle is above a certain threshold, or have the magnitude of the force be a factor of the angle of the ground. With this method, you could even have a car climb a 90 degree wall if the force was high enough.
use torque which is the strength of motor itself. boost it up to beyond 10k, with proper friction and density the vehicle should be able to climb the hill slopes
I will be making a proper tutorial for this sometime, but for now the basic idea goes:
- main body is fixed rotation
- main body and 'wheel' body are joined by prismatic + revolute combo (requires another body between to link them)
- movement is just done by changing the revolute motor speed
- 'suspension' effect has a few parts:
1. cancel gravity on the main body
2. use prismatic joint motor to push bodies towards the suspension's natural rest distance
3. scale this force down when the rest position is closer to simulate spring
4. set prismatic joint max force appropriately so joint can't react too quickly
- prismatic joint does jump with temporary large max force and speed
- prismatic joint limits are set to crouch distance and maximum jump extension distance
- change some of these numbers to crouch