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"

4.18 TLazyObjectPtr Losing References when playing in Editor

I noticed today just simply mapping a TLazyObjectPtr to any kinda object and playing in the level after you mapped it basically resets it back to null even if that object wasn't created yet in game-play and yes im in the same level i mapped the object to and the same with the object holding the TLazyObjectPtr variable so its not a cross level reference either. You'll notice this occurs and the action that did need to play does occur for the AI sitting if i wait a few more seconds. But the moment i press esc and close the play session it resets the variable to null. If i reload the engine and dont save any changes the reference comes back to exactly what it was before i attempted to play in the editor.

We use these a lot in patrol systems four our game so level designers can create patrols quite easy with the eyedropper tool. This didn't occur in 4.17 as Ive reverted my code back to before we updated and installed the last engine and it worked. Was this a recent change or just a new bug introduced in 4.18?

alt text Heres a closeup of the variable changing. alt text

I simply just declared the variable like this, mapped it and once you play in the editor it automatically clears the value...

 UPROPERTY(EditAnywhere, Category = Config)
     TArray<TLazyObjectPtr <AI_Object_POI_Scripted> > POI;


Product Version: UE 4.18
Tags:
more ▼

asked Nov 27 '17 at 11:55 AM in C++ Programming

avatar image

Dark583
86 6 88 16

avatar image UPO33 Nov 28 '17 at 01:20 PM

cant u use TObjectPtr instead?

avatar image Dark583 Dec 02 '17 at 04:40 AM

Will that work for setting references as i need to? Via an object dropper in the world?

avatar image Dark583 Dec 11 '17 at 04:53 AM

Any suggestions from the Epic Guys? Still having issues and it only occurs in 4.18 . Heres a video explaining the issue https://youtu.be/vlO-dhmz7rs

avatar image dark-killer Dec 11 '17 at 04:38 PM

tried to reproduce it by adding the array with lazy pointer to my pawn, pointing at a new class with only a billboard, but the reference stays, so i would look into what AI_Object_POI_Scripted does when you finish playing in Editor

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
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