Why doesn't my collision detection between two Area2D objects in Godot 4 work?

AI Thread Summary
The discussion focuses on detecting collisions between a circle and a floor in a script where the circle is falling. The initial setup appears correct, but the collision detection is not functioning as expected. Key points include the importance of understanding the tutorial material rather than following it blindly and the suggestion to verify if the '_on_body_entered' event is triggering before implementing additional collision code. This indicates a need for troubleshooting to identify the underlying issue with the collision detection.
Darkmisc
Messages
222
Reaction score
31
TL;DR Summary
I've followed steps from a tutorial on how to set up collision detection between two Area2D objects. It's not working and I can't figure out why.
Hi everyone

I'd like to detect collisions between a circle and a floor.

I have set them up as follows:

1684196663869.png

1684196709419.png
1684196621540.png


1684196743781.png
The script runs fine (it's just a circle falling towards the floor), but nothing happens when the two objects collide.

Does anyone know what I've done wrong?Thanks
 
Technology news on Phys.org
Darkmisc said:
Does anyone know what I've done wrong?
Yes, (1) following a tutorial blindly without thinking and (2) giving up before you have tried to find the problem.

Before you add the 'if body.is_in_group' code you should test to see if the '_on_body_entered' event is firing.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...
Back
Top