Code changes in newer versions of Godot

This post lists changes in the GDScript syntax since the initial release of the course.

body_entered signal

This issue only applies if you use Godot 3.2.0 stable. It is an engine-side bug that was fixed in Godot 3.2.1.

In the lesson Making the Enemy die when jumped on, we use the body_entered signal of the Area2D class. The type hint of the argument 'body' is now 'Node' instead of 'PhysicsBody2D'.

You should write

func _on_StompDetector_body_entered(body: Node) -> void:

Instead of

func _on_StompDetector_body_entered(body: PhysicsBody2D) -> void:

Otherwise, you will get an error.

Community Discussion