Get the GUID of entity?

The docs cover finding a child by GUID but doesn’t mention - does every entity have a GUID? Seems like that’s missing from API docs.

https://developer.playcanvas.com/en/search/?q=guid

Is it assigned when the entity is created or added to the graph?

Thanks,

Bruce

Hi @brucewheaton,

Good point, there isn’t any public API on this. You can use a private property to get access to the guid:

this.entity._guid;
1 Like

Every entity has a GUID. In the editor, they are already assigned a value that must not change as the component system is dependent on it. I also think that the engine gives one to new entities that are created at runtime

1 Like