#Car with abrupt bouncing on rotation when hitting the wall

2 messages · Page 1 of 1 (latest)

quartz sedge
#

When a car (RigidBody2D) collides with a wall (StaticBody2D) in state.angular_velocity != 0 and immediately moves to the opposite direction, an abrupt bounce occurs:

https://streamable.com/latytj

HTML5 demo:

https://hydroper.itch.io/carknockonlinetest

Car source:

https://github.com/hydroper/carknockonline/blob/master/src/entities/AutomobileEntity.gd

It uses Godot 4.1 for using static var.

To better describe the problem, the acceleration changes abruptly due to the rotation. The code in _integrate_forces mutating state.linear_velocity is just for applying max speed and deceleration.

GitHub

Contribute to hydroper/carknockonline development by creating an account on GitHub.

quartz sedge
#

Car with abrupt bouncing on rotation when hitting the wall