Get unique ID of actor

For debugging purposes, I would like to get the ID of an actor inside my blueprint logic. By this, I mean the actual unique actor label that is automatically assigned to each actor when it is instantiated in the editor.
“Get Object Name” sounds like the right idea but it seems unavailable to me in 4.7.

1 Like

Object name is unique, it’s add number to class name for each instantiated object

2 Likes

I can’t see this node in my version of unreal (4.7) - all I can see is “get display name”, which returns the name of the class itself - is there something I’m missing here?

Do you search it in context menu or library?

According to Release Notes GetObjectName node was added in 4.8.: “New: Added GetObjectName to return the exact object name of a UObject” - Unreal Engine 4.8 Release Notes | Unreal Engine Documentation

That’s great news for me actually. Thank you for the info.

ah ok, didn’t know it’s been just added

Thanks, I’ve updated to 4.8 and was able to use the “get object name” node.

so how do you do this? Make a blueprint from an static mesh from content creator. And then in construction script, do “get object name” element?

Pay attention: name is guaranteed to be unique inside the same level. if you have multiple streaming levels in your map, there could be two actors with the same name (each one unique inside its own level!)
if you want an unique identifier in this situation, you could link these info together: _.
Bye! :wink:

2 Likes

if you spawn 2 staticmesh actors and give them the same label (for example “myactor”) into the world outliner, try to hover the mouse over them; it will appear a tooltip with the object name in question.
one will be named “myactor”, the other probably will be named “myactor_1”. this is the name retrieved with the GetObjectName blueprint function :wink: