Getting a certain type

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Marmot

I don’t know how to make sure that I get a certain type of node. What I mean by this is that I’ve made characters and I want to check (when colliding) what type of character it is. Is there a way to check if the colliding object is an instance of a specific resource or something similar, like getting the object’s class in UE4?

Thanks in advance.

:bust_in_silhouette: Reply From: eons

You can use get_class().

But better and more flexible than a class check is to use groups and check if the collider is_in_group, as objects can have multiple groups assigned (in the editor or script) and are not restricted by the class name.