I'm making a shooter game, and when raycasting I want to check if I'm hitting a player. As far as I can tell, the following line in my "player.gd" script should check if "hit" is an instance of "player.gd":
if hit is get_script():
However, it results in the following error:
Invalid "is" test: the right operand isn't a type (neither a native type nor a script).
I don't quite understand this; it's saying that get_script() is not a script? How do I figure out if I'm hitting a player? Is there any information that details how the "is" operator works? I have a hard time looking for it, since the word "is" is rather common.