Losing ordinal numbers from instanced node names?

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

Hi All-

When a node is instanced with a name and another one instanced again with the same name, Godot will add ordinal numbers to the names (instance name ,instance name2, instance name3, and so on).
Is there a way to get the name of the selected instance but lose the ordinal number suffix (ie, just get the name stem itself without the ordinal, for referencing purposes - i want to be able to match this selected name to another one but I can’t get a match when both the matched and the matching names keep getting various ordinal suffixes)

:bust_in_silhouette: Reply From: njamster

Add the base scene to a group and instead of comparing the name, check if the instance is part of that group using is_in_group("<GroupName>").