Announcement

Collapse
No announcement yet.

FObjectFinder can't find resource "sometimes"?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    FObjectFinder can't find resource "sometimes"?

    So in the attached picture I show where I'm trying to find a blueprint by it's path. The Initialize routine is called directly after the object is created using NewObject<> in a parent class. The parent class (GameMode) creates this object in the BeginPlay override.

    What I find that is odd is that if I move the code into the constructor and remove the Initialize routine altogether it works just fine when the parent class creates it. I'm not sure what is causing this.

    The reason why I chose to move the code into it's own Initialize routine is because the constructor seems to be called when the Editor loads even though the game mode hasn't performed a BeginPlay(). I'm guessing that since it is a UObject that Unreal needs to instantiate it once to get some information for Reflection purposes. This method does a lot of heavy lifting so I didn't want to put it into the constructor for the Editors sake. I want to make sure it fires off only when a BeginPlay event kicks off..

    Thoughts?

    Thanks!
    -jv
    Attached Files

    #2
    I don't have a solution for you, but as far as I know, the engine will crash if you call a ConstructorHelper outside of a constructor.
    Maybe that code is not being called at all?

    Comment

    Working...
    X