My car doesn't want to stop

So i made my car mechanics based on the basic top down car project example but when my car stops there exist a small movement to -Y axis i don’t get it why…

For me is like the TimeDelta forces fight each other and the -100* win
Is there a way to stop the car from any movement via js?

1 Like

You don’t need JS for that, just tweaking your events. The current problem is that it never reaches a perfect 0.
It would help to see the acceleration events, but you can make a “if acceleration is < 1, do = 0 to acceleration”. That way, neither condition is valid.

1 Like

Actually with your suggestion the car stops directly i need a way somehow to clear the delta time ; do we have any way to do that via conditions?

I don’t know what you mean by “clear the delta time”.
Actually, why do you need a “if acceleration is < 0” event ? :thinking: Your comment says “slowing down car”, yet you are increasing the value…

I followed the official top down car example.
I had it in my mind like in nature when two equal forces strike each other ( lets say delta time here) the impulse stops…but i did a research about the delta time and is just the time between the last and current frame right?
Finally I found a solution implementing a handbrake that stops the car for sure and is more natural and nice now.
But i want to know how we can apply impulse physics to a car in GDevelop?

Yes! Usually worth about 0,01 I think.

Are you talking about the Physics 2.0 behaviour?
There are a couple of Physics example, you should take a look at them, and play with the events to see how Physics works.
But Physics is useful when you need gravity, bounces, axles, etc. I’m not sure it’s a good idea for a topdown car game. :thinking:

1 Like

No is not , i tried the dynamic without gravity the kinematic nothing works well for top down game ; but ok is very good as it is for me right now i have what i want so i’m satisfied.

1 Like

Greetings…! I’m new to the community and I’m facing a problem related to this topic. I am creating a small 2d racing game and I can’t configure the acceleration of the vehicles nor the deceleration… I found a tutorial on youtube but I can’t get gdevelop to recognize the commands… the line I used is the following…: image
Whoever can help me… welcome the knowledge…

Have you had a look at te template top down car racing game for ideas on how to move?

(Also, next time don’t reply to a 3 year old message, but start a new topic and link to the old topic)


Ok… I’ll try that… it’s a lot of information to assimilate at first… and sorry for not starting a new topic…