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: Vehicle.gd and Player.gd, Player.gd is inherited from Vehicle.gd.

In Vehicle.gd I have an _integrate_forces function which calls some functions.

func _integrate_forces(state: Physics2DDirectBodyState) -> void:
	_round_velocities()
	_determine_direction()

In Player.gd 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 Vehicle.gd

func _integrate_forces(state: Physics2DDirectBodyState) -> void:
	_handle_steering()

How do I make it so that the _integrated_forces in Vehicle.gd is not overwritten when I have another _integrated_forces in Player.gd?

: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.