I have a bunch of enemies walking around the game scene, they all have a @export var fruit : PackedScene
associated. For debugging purposes, I’d like to see which enemy has which fruit so I’m trying to assign the name of the Fruit to a label’s text every enemy is tagged with. But I’m always getting an empty string? I tried various things but the closest I got to what I’m looking for is to use text = fruit.get_path()
which gives me the correct path but I don’t like this because it’s too long (I just need “Apple”, not the whole “res://Items/Edibles/… .tscn”)
If there’s no direct way I’ll just process the path name that I can obtain with get_path(), but is there a direct way of getting the name of the PackedScene?