Physics for car movement?

This forum is currently in read-only mode.
From the Asset Store
Everything is made via physics, Very simple code: 6 events only (3 for tank creation, 2 for controls and 1 for camera)
  • Hi everyone, I'm trying to create a slightly more realistic car movement engine by using the physics engine instead.

    I reckon I would have it all figured if i knew how to make the physics engine apply velocity to something in the direction that it's facing. That way (hopefully) the physics engine would more accurately handle crashes, rather than making the car go the opposite direction etc.

    Anyway I'm assuming it's got something to do with math and trigonometry since velocity seems to be X and Y based rather than directional, but I've COMPLETELY forgotten all that stuff, if anyone could help out it would be great thanks <img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" />

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Wait I think I got it now:

    set x velocity to x velocity + cos(sprite.angle)

    set y velocity to y velocity + sin(sprite.angle)

    i have NO IDEA of the maths behind it but it seems to work fine yay! I just knew it had something to do with sin and cos so I randomly tried things till i got it haha

  • Ashley (Tigerworks) wrote a nice car movement tutorial on the clickteam knowledge base, obviously that was for MMF so wouldn't work directly, but he explain all the maths behind it and you could of probably reproduced it in contruct woth out too much effort.

    The knowledge based seems to have been abandoned though and most of the pages don't work any more.

  • .cap ?

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