Godot Version
Godot Engine v4.5.1.stable
Question
I’m trying to let the player to apply a force on a ball, but it doesn’t work when putting the apply_impulse() in integrate_forces() like this below
# ball.gd
func _integrate_forces(state):
if pending_impulse != Vector2.ZERO:
apply_impulse(pending_impulse, pending_offset)
pending_impulse = Vector2.ZERO
...
However when i use the apply_impulse() outside _integrate_forces() , it works. For example, in the physics process loop of my player script, I call ball.apply_impulse() when a certain key is pressed.
I’ve been struggling with this issue for a while and would greatly appreciate it if someone could explain the reason and help me get it solved.