0 votes

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)

asked May 9 in Engine by Macryc (289 points)

1 Answer

0 votes

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>").

answered May 9 by njamster (8,874 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.