A Node cannot enter an area, nor can a Node2D. bodies are necessarily PhysicsBody2D, so you shouldn't have an issue.
If you do, you can always add an extra type check in the callback method:
if not body is Monster: printerr("Some error message for debugging: %s" % body.name) return
Thank you for explanation. Seems the difference between 3.1 and 3.2 branches is in type hinting for body entered signal in area_2d.cpp:
3.1: ADD_SIGNAL(MethodInfo("body_entered", PropertyInfo(Variant::OBJECT, "body", PROPERTY_HINT_RESOURCE_TYPE, "PhysicsBody2D"))); 3.2: ADD_SIGNAL(MethodInfo("body_entered", PropertyInfo(Variant::OBJECT, "body", PROPERTY_HINT_RESOURCE_TYPE, "Node")));
Same Node issue in Godot 3.2 here. I found a solution in YouTube. Not sure if it is correct, but it works.
func _on_StompDetector_body_entered(body: Node) -> void: var physics_body: = body as PhysicsBody2D if physics_body.global_position.y < get_node("StompDetector").global_position.y: get_node("CollisionShape2D").disabled = true queue_free()
I'll add this to a list of code changes in Godot 3.2. Thanks.
Done, there's now a lesson that will list syntax changes in newer versions of Godot: https://gdquest.mavenseed.com/admin/courses/create-your-first-2d-game-with-godot-extended-edition/lessons/code-changes-in-newer-versions-of-godot/edit
Thank you for the very quick response and an excellent e-course!!!
Just a suggestion here: I think Margus' suggestion to cast the Node to PhysicsBody2D should also be part of the API change note under the video.