Reference Static Mesh Outside of Constructor

Trying to reference a Static Mesh but not through ConstructorHelpers::FObjectFinder. Is this possible? I’m referencing Kamrann’s post here:

The reason for this is that before I add components, I was asking the GameMode for certain variables. But referencing GameMode in the constructor returns NULL which I read here its a bad idea to reference objects in the constructor:

Anyone have an idea how to do this then? Just need to grab the object with this reference:

I’d appreciate any help!

Ok, upon further research i found a link here which i think details the process. I’ll post again if this works.

I haven’t been able to get the code to work. It appears to load the object from the path but then the NewObject Command says the static mesh is null? Does anyone have an idea?

Got it to work after finding that RegisterComponent must not be what is needed in this instance. Apparently RegisterComponentWithWorld(GetWorld()) is the way to go. Hopefully this will help someone later who has the same issue.

this link is sadly no available anymore, this is the second time i find this, and it is really saddening because this is blocking my whole project :frowning: