x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

What is an Actor's Constant/Persistent Unique Identifier?

I am looking to serialize all Actors in a particular level, to be saved out and restored later. This is fine, except I need a key for each Actor to use. I have been looking at GetObjectName() and GetUniqueID(), however I don't think either of these ID types fulfill the following requirements:

  1. ID is unique for each Actor in the level

  2. ID does not change between level loads

What identifier would you use? Do I need to add a UUID property to differ all instances of my Actors?

Product Version: UE 4.9
Tags:
more ▼

asked Oct 06 '15 at 09:15 PM in C++ Programming

avatar image

zerosum0x0
31 2 4 9

(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

GetUniqueID()

Returns the unique ID of the object...these are reused so it is only unique while the object is alive. Useful as a tag.

So I think they will be unique between level loads, only if objects are alive.

I was using hashed GetObjectName() to identify objects on my level. And I think both functions fulfill the first requirement.

But if you need UniqueID between levels, or even different instances of the game (from save files ex.) you should use your own actor field. If you have no option to make your own field, than I think GetObjectName() is dependent on actors class name and sequence of object creation. So reloading the same static level twice will produce same object names.

So adding your own ID would be the better option.

more ▼

answered Oct 06 '15 at 09:35 PM

avatar image

Yata
539 37 46 68

(comments are locked)
10|2000 characters needed characters left

Bump this question. Is it really guaranteed that GetObjectName() will return the same name between level load? Documentation is REALLY lacking :(

more ▼

answered Aug 03 '17 at 04:42 PM

avatar image

raianlp
32 4 10

avatar image rit Sep 25 '17 at 08:05 AM

Bump this question.

I need to have an ID referring to each actor that is both UNIQUE and PERSISTENT.

avatar image AJQuick Dec 09 '17 at 04:12 PM

bump 10 char

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question