Get name of object/scene during collision

If you have scenes for your arrow and block. I would put a class_name on each script respectively

class_name Arrow
class_name Block

Then you would check like this

If raycast.get_collider() is Arrow:
    ...
elif raycast.get_collider() is Block:
    ...

This is a class check, and will sense if it is a node with a custom script and get the class_name.

2 Likes