All Questions

Community

K
Jernej Kladnik

body_entered function argument type changed to Node in Godot 3.2

I've noticed that the body_entered function argument has been changed from PhysicsBody2D to Node in Godot 3.2. Since in this tutorial we're making sure only Player may enter the StompDetector via collision mask it is safe to assume that the body entering will have global_position property inherited from Node2D. But in case a node that does not inherit from Node2D would enter the area it would lead to a bug in the code. I am unsure what the reasoning behind the decision to modify this attribute type to Node was since when dealing with 2D games all 2D related nodes extend from Node2D.