appsinacup/godot-rapier-physics

Rapier incorrectly returns null on state.GetContactColliderObject

Scuas opened this issue · 0 comments

Describe the bug
state.GetContactColliderObject in _IntegrateForces returns null when it should return a valid node.

To Reproduce
Steps to reproduce the behavior:
Create a c# rigidbody script with the following and run collisions with it (make sure contact monitor is enabled).

 public override void _IntegrateForces(PhysicsDirectBodyState2D state)
    {
        if (state.GetContactCount() > 0)
        {
            GD.Print("object: ",state.GetContactColliderObject(0));
        }
        base._IntegrateForces(state);
    }

If using the example project: Download rapier2D and switch physics engines, hit play. You will notice that the output changes depending on engine used.

Expected behavior
The output should read "object: Rigidbody#" when a contact is detected.

Environment (please complete the following information):

  • OS: [ Windows]
  • Version [[175c45e]]
  • Godot Version [4.3]
  • Type [simd single]

Example project(zip)
rapierexceptionsissue.zip