Godot Version
4.2
So for a couple weeks I had this annoying “bug” with raycast2d. When an enemy would get close to the player character, the raycast2d would not collide with an enemy that was right in front of my player character, and my bullets would just hit the wall behind the enemy.
I brushed it off and kept working on implementing other stuff. Then, just 10 minutes ago, I circled back to this annoying problem.
Guess what? Reading the documentation is a good idea that might have just saved me an hour or 2 of implementing workarounds!
raycast2d has a property: hit_from_inside. And guess what? When you turn it on, the problem magically disappears.
Imagine taking 5 minutes to read the documentation instead of taking 2 weeks to figure out a solution or wasting 10’s of minutes refactoring to make use of some other approach.