How to not overwrite _integrate_forces when inheriting from a script

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Thomas Crammy

I have two RigidBody2D scripts: and, is inherited from

In I have an _integrate_forces function which calls some functions.

func _integrate_forces(state: Physics2DDirectBodyState) -> void:

In I want to call more functions in it which is specific to the Player. But whenever I put anything in the Player _integrate_forces functions it overwrites the _integrate_forces from

func _integrate_forces(state: Physics2DDirectBodyState) -> void:

How do I make it so that the _integrated_forces in is not overwritten when I have another _integrated_forces in

:bust_in_silhouette: Reply From: Zylann

So _integrate_forces is replaced by your implementation in the derived class?

In that case you can call the base class method by calling ._integrate_forces(state) in the derived class.