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.

1 Like

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

what u want are GUIDs

there are a function called “new GUID” to create a new GUID

just bumped this, for others like me, bec. it the number one on the google page :smiley:

Note that as of UE5 (?) objects already have one, so you don’t really new to generate one unless you’re after something specific.

This depends on exactly what your wanting to do, you could save a reference to the actor along with its data in a saved game, but if it’s going to be manipulated much later the exact object may no longer be valid. Is this a static/placed actor or one that is spawned in at runtime? More precise details on your objective would help

There are no objectives here as this thread is no longer valid, in a way. Note it’s very old and the poster above merely necroed it. GUID was not available in UE4 BP. It is now.

1 Like

Didn’t see the original post date lol

1 Like

Yes but the “Standard GUIDs” are only for Editor purpuse

Bec. is says Editor only, then i only use it in the Edior :sweat_smile: and i dont think that u will ever run into an issue for having to much GUIDs

1 Like

I’ve had no issues so far; but yes, I’d like to think it’d be safer to generate your own.

I would also be curious how you got that to work because I ran into the same issue as DaUik when trying to use that guid, it was unavailable in packaged builds.

I was able to get around it by copying it into a custom component purposely built to persist that value. But the callbacks that make that work are specific to C++ and therefore not a viable solution for a blueprint discussion.

But it was worth it to not have to deal with the hooks for actor creation, duplication and whatnot that the Engine already deals with to manage the guid that DaUik referenced.

1 Like