# Car Physics

0 favourites
• 22 posts
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)
• Hello,

I was playing my game, Cops and Robbers 3 (Play it on my website or the Scirra Arcade) and I realized that there are some very unrealistic things. For example, a player on foot can be standing there, and a player in a car rams into them and bounces off, while the player on food didn't move. So, I figured the solution is to use physics. The problem is that I use the car behavior to move the cars, and physics does not work like car behavior.

Is it possible to make physics work like the car behavior? You would probably have to make it so you rotate based on how fast you're going. I'm not that crazy for using third party add-ons, but if there are some I might check them out.

Any help will be appreciated,

Give me a Pixel

• ## Try Construct 3

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

Construct 3 users don't see these ads
• Still not perfect, but by combining physics and the car behavior, I was able to create something a little better than just plain car behavior. I also added a pedestrian (which would be the cop or robber on foot in the game). If anybody has any ideas, please post here.

• If possible, I want for the car to be moved by physics alone. I have an idea about how to make it, but nothing absolute yet. What if it was made like a real car? So have a body, front right wheel, front left wheel, back right wheel, and back left wheel. Pressing the right arrow will turn the front wheels right, pressing the up arrow will make the back wheels turn. Does anybody think this is a legitimate solution? Like I said, it's just an idea, but it could possibly work. I wouldn't know how to do it though. . .

• I'm getting somewhere with my idea. However, right now the car can turn the same speed regardless of how fast it is moving. There are only velocity x and velocity y expressions. I need to get the total velocity. Is there a way to get the total velocity (how fast the car is moving)? Ashley, can you help me?

Thanks,

Give me a Pixel

• bump.

• Here is a simple way to get overall velocity:

velocity=distance(0, 0, velocityX, velocityY)

• Thanks so much!

• Hello again,

I have made some progress on the car physics. However, they are not at all like they should be. Can anybody see if they can make the car move more realistically? Also, if you are going in reverse, the controls are not reversed like they should be.

Give me a Pixel

• Here is a Car Physics behavior made by CodeMasterMike. It would be absolutely perfect, however it is for C2. Any chance this will be converted to C3? If not could we have the code so somebody can convert it? I would gladly do it but I have no clue how to make a plugin at all. . . I would also be willing to learn how. Help, somebody?

• Ok guys, I recently did some searches for doing top down car physics and found some results. Unfortunately, they are in JavaScript or some coding language which I do not know. I really need the kill lateral velocity part, which basically gives the wheels 'friction' so they can only move forward in the direction they are facing. You can read more about it in the sites I found. Can somebody translate this into Events?

Here are the websites:

Thanks in advance, I really want good top down car physics so I can make a new version of Cops and Robbers.

• I found the Construct 2 car physics plugin on GitHub. I also found the source. Can somebody PLEASE help me turn this into a plugin? Here is the source code: github.com/qertis/c2-car-physics

• Give me a Pixel It's already a plugin. Just copy car-physics folder into C:\Program Files\Construct2\exporters\html5\behaviors or similar folder.

• Is it for Construct 3? I don't use C2.

• Sorry, I thought this was C2 forum.

It looks like a big and complex plugin. Porting it for C3 must be a huge task.

• Is it possible? I will help in any way I can.

• 22 posts