Godot: VehicleBody is missing important functions that Rigidbodies have

Created on 26 Aug 2017  路  4Comments  路  Source: godotengine/godot

Operating system or device, Godot version, GPU Model and driver (if graphics related):
Windows 7 x64 d8cd849

Issue description:
I need to play sound/sfx/get velocity when the car collides with stuff. I am unable to do so because vehiclebody does not have the get_colliding_bodies() or is_contact_monitor_enabled()

I would use signals, but vehicle body doesn't have body_enter, body_enter_shape, body_exit or body_exit_shape signals either.

Steps to reproduce:
N/A

Link to minimal example project:

enhancement physics

Most helpful comment

Indeed, it seems the VehicleBody is lacking some functionality. Another important one I'm missing is the ability to set the vehicle's linear/angular velocity, which is useful when you want to reset a car after it has crashed, for example. Strangely, there's get_linear_velocity() but not set_linear_velocity(). It seems it would make more sense if VehicleBody inherited from RigidBody instead of CollisionBody, and that it would override integrate_forces() to change the default RigidBody physics behavior.

All 4 comments

Indeed, it seems the VehicleBody is lacking some functionality. Another important one I'm missing is the ability to set the vehicle's linear/angular velocity, which is useful when you want to reset a car after it has crashed, for example. Strangely, there's get_linear_velocity() but not set_linear_velocity(). It seems it would make more sense if VehicleBody inherited from RigidBody instead of CollisionBody, and that it would override integrate_forces() to change the default RigidBody physics behavior.

We have now entered release freeze for Godot 3.0 and want to focus only on release critical issues for that milestone. Therefore, we're moving this issue to the 3.1 milestone, though a fix may be made available for a 3.0.x maintenance release after it has been tested in the master branch during 3.1 development. If you consider that this issue is critical enough to warrant blocking the 3.0 release until fixed, please comment so that we can assess it more in-depth.

As a matter of fact there's an open PR #14907 which fulfills this and I believe the PR is for 3.0 due to API changes?

Hm, yeah. It's way too late for such changes, but it's either now or via a new RigidVehicleBody node..

Was this page helpful?
0 / 5 - 0 ratings