This is a bit of a nitty case, but the other day I was trying to access the name of an entity that I had spawned from a template at runtime, and found that it was always called “RootNode” no matter what I called the template.
If I spawned the entity manually before running the project (by drag dropping the template into the scene), the name of the entity was the same as that of the template, which is what I would expect.
Soo… there seems to be “bug” that runtime spawned entities does not inherit the name of their template. Anyone else bumped into this issue?
hm… I also used instantiate() but perhaps you named your entity before you converted it to a template? At least the GitHub issue is exactly the same as I experienced.
Here’s a snippet of the code that spawned our template:
let newEntity = newEntityAsset.resource.instantiate();
this.entity.addChild(newEntity);
console.log(newEntity.name);