Godot Version
4.2.1
Question
I have been working on a simple game where you drop balls from the top and hit other balls that stay in one place below. I am try trying to use a script to detect when the two objects touch each other by using the _on_body_entered function but it does not work. The structure of the static balls which are stored in a scene goes: StaticBody2D > Collision Shape2D + Sprite2D. The bouncing balls are the same except I use RigidBody2D instead of static body. The script is attached to the Collision Shape. Here is my code:
extends StaticBody2D
func _on_body_entered(body):
print(body)
I have tried moving this script to the StaticBody2D node and I’ve also attempted to add a script to the bouncing ball, but nothing works, and nothing is ever printed to the console. The objects are also have the same collision layering and the sizes are the same. Thanks!