Not getting expected results from state.get_contact_impulse() function

Godot Version

Godot Engine v4.2.2.stable.official.15073afe3

Question

I’m trying to access the impulse vector, when two RigidBody2D objects colloid.
For this I wrote this in my RigidBody2D gdscript:

The problem is, when there’s a collision and I see the print “APPLIED IMPULSE”, I always get 0 for state.get_contact_impulse(0)
why is that? I’m expecting it to be printed for each colliding object and display the impulse applied to them because of the collision.

There are only two objects of type RigidBody2D, names pen_fighter, and pen_fighter2. I’m attaching the log I see for this code when these two objects colloid:

state.get_contact_count() = 1
get_colliding_bodies =[]
state.get_contact_count() = 1
get_colliding_bodies =[pen_fighter2:<RigidBody2D#24930944216>]
state.get_contact_count() = 0
APPLIED IMPULSE = (0, 0)
get_colliding_bodies =[pen_fighter:<RigidBody2D#24880612557>]
state.get_contact_count() = 0
APPLIED IMPULSE = (0, 0)
get_colliding_bodies =[]

I think it could be related to this bug:

I read up some documentation and saw changing below value could help:
physics-tick-per-second from 60 to 240
max physics steps per second from 8 to 32
I was able to see some impuls values. But those values are not as I expected.

Hi @amityadav381 , did you manage to figure out this topic?

Hi @dooferino I changed my solution to not include this approach.
here’s the complete game I made.