Uniquely Identify Actors in Blueprint

If I want to uniquely identify actors for later manipulation by storing the unique ID’s somewhere, what can I used to uniquely identify them in a Blueprint project?

The only built-in label I can find is “Get Display Name” which explicitly states “This function should not be used to uniquely identify actors!” in its description.

Do I need to manually add GUIDs to actor types that I want to uniquely identify instances of, or is there a system unique ID that I can tap into within the blueprints environment?

It seems that GetUniqueId is what I want, but I don’t see any way to access it from within a blueprint.

I’m bumping this because I also want to know the answer and I haven’t been able to find anything with basic googling skills other than this thread.

Bumping this again! Anyone please help to solve this issue! Thanks

Doesn’t each object have a unique name. Why not just use a spawned actors unique name?

Oh I see, you are using get display name. What you probably want is get object name.

Get Display Name- Get Display Name | Unreal Engine Documentation

vs

Get Object Name- Get Object Name | Unreal Engine Documentation

Get Display Name apparently is meant for debugging purposes so it’s probably not what you want.

Is the Object Name unique only in current instance of the game or across different instances?
When I run the game two times, will the object name be the same for the same object?

It likely depends on order of actor being spawned since the Object Names will be sequential like BP_Class1, BP_Class2, BP_Class3, etc… It has some randomness that might not be reliable.

You should try using Tags on Actors you want to identify, which can be checked using ActorHasTag

Yeah, I know about Tags but the problem with them is that you need to set them manually, it’s an option but adds an additional steps in something that I’m trying to make as much automatic as possible.

If the number of this type of actor is the same then it should be working I guess . I’m thinking about using it to identify widgets on the screen and save the location of them.

Get Object Name can change between loads, so it’s not suitable as a unique ID (I had been using it until I ran into issues and did some debugging).

1 Like