I'm getting the acceleration of my RigidBody2D this way (it work):
func _process(_delta):
calc_acceleration()
func calc_accelerations():
var v0 = linear_velocity
var r0 = angular_velocity
var dt = 0.1
yield(get_tree().create_timer(dt), "timeout") #wait for dt seconds
var v1 = linear_velocity
var r1 = angular_velocity
acc = (v1 - v0)/dt #dv/dt
racc = (r1 - r0)/dt #dTheta/dt
But the yield() induce lots of errors when my RigidBody2D is deleted from the scene. I use queue_free() to delete it.
Is there a clean way of accessing the acceleration ?
I tried putting a Timer child but it didn't worked with small delay