0

I use apply_central_force in a top-down 2D car game to move a car. I had to limit the linear velocity separately in _integrate_forces and that causes a bouncing or elasticity when hitting a wall. Any ideas if there's something better to do?

Would I've to use a CharacterBody2D instead?


The car moves to the directional you press. It rotates to the direction you go. The issue is that when the car performs a drift of around 180º degrees in a wall, it gets a slight bounce.


I'm using a constant angular velocity for tweening the car's rotation to the direction (i.e. up, up-left, left_ and so on).

Hydroper
  • 344
  • 2
  • 9
  • 1
    Using `_integrate_forces` is what comes to mind, I do not know about the bouncing/elasticity you mention... However, I'm aware of a fix for the velocity in `_integrate_forces` that was merged for Godot 4.2 (currently in dev builds), could you check if it fixes the problem? – Theraot Aug 25 '23 at 01:06
  • @Theraot Just tried it, but I guess it's not a Godot bug really, it's just the way I'm tweening the rotation. – Hydroper Aug 28 '23 at 15:57

0 Answers0