side scrolling car physics

This forum is currently in read-only mode.
From the Asset Store
Change the size and position of everything without calculating anything!
  • I wanted to make a 2d car with physics behaviour which would roll down a slope. I made a car body with physics enabled and 2 wheel objects also with physics enabled. I added the two wheels to two differant image points on the car body. When I run the game, the car flies upwards instead of rolling down th slope. Please help. At least point me to a topic for this issue and I shall be grateful. Please suggest if you need a cap posted here.   <img src="smileys/smiley5.gif" border="0" align="middle" />

    PS : I had posted this in a differant forum earlier. Please bear with me as I am new to forums and will sonn pick up the etiquete

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Some help please...Anyone?

  • Ah, to position physics objects you need to disable the physics behavior, move them, and then enable the behavior, and set the velocities to 0.

    This doesn't work in your case though, as you want the wheels to move the car body. In that case you'll probably need to create a physics joint/hinge between them but I'm not quite sure how that is done exactly.

    Your method would work in reverse for a one-wheeled/physics body object though, where you can position the non-physics object to the physics objects image point and it shouldn't glitch.

  • Thank you for the reply , but I did not really understand this... I am working around it by adding a rotation behaviour to the wheels, and physics behaviour o the car body. It is a woeful workaround, but with carful timing I am managing it for now. <img src="smileys/smiley20.gif" border="0" align="middle" />

  • hi. im not sure if i understood correctly, but anyway, i threw together a little example .cap for a 2d car physics, or at least one way of doing it. its just a barebones example with only a few events. you could add alot of things to it, like subtle steering while on air and stuff like that,also you can tinker with bounciness and traction and stuff to your liking,just have to experiment with the physics behavior. hope it helps even if just a little.

    grab the .cap here:

    http://dl.dropbox.com/u/11157144/2d-car-physics.cap

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)