This is my inheritance class structure:
Node2D:
GridBlock:
BlockWithRays:
Block
Glider
My Block has RayCast2D inherited from BlockWithRays. I want it to check if its rays are colliding with either a Block, or a Glider. The problem is get_collider() returns a Node2D object when it collides with either a Block or Glider.
I tried to set the bool constant is_glider in Block and Glider to check, but an 'invalid index' error arises when accessing it from the result of get_collider().
What's going on? How do I solve this issue?
Edit: The idea of adding is_glider to the objects worked. The problem was I was asking the area that collieded, not it's parent... So it's solved. If you have another idea of how to solve it better I'd love to hear it.