Lukis February 2016

Wheel Joint 2D motor and gravity

I'm creating a 2D car game (driving hills). I use Wheel Joint 2D to implement car suspension and wheel rotation. It works quite well on flat terrain.

Now I would like to add a gravity influence to a motor speed. Unfortunately gravity works only when I deactivate useMotor. Otherwise I just stand on the side of a hill and don't move.

Is there any way to sum gravity and motor velocities?

Answers


andeart February 2016

I think what you want to do is reduce the friction between the wheels and the ground. Experiment with the physics material you set on the wheels and/or the ground.

I hope that helps!


Lukis February 2016

I figured it out. Here's a sample project with motor script attached.

Now it works like a charm!

http://www.thegamecontriver.com/2014/11/hill-climb-racing-like-2d-car-physics-2.html

Post Status

Asked in February 2016
Viewed 1,274 times
Voted 7
Answered 2 times

Search




Leave an answer