I’m not sure what is wrong with it but it seems to not be setting it to my variable. From the look of my code and its output it finds the object but doesn’t set it to the variable. Here’s a picture of the code: https://cdn.pbrd.co/images/HLtfjQK.png and this is a picture of what it outputs: https://cdn.pbrd.co/images/HLteUxu.png
If anyone can workout why this isn’t working could you explain to me?
To help figure out your issue can you please post the entire code where ConstructorHelpers is used. Having more context might help in solving the problem.
Please note that I don’t know much of c++, but i’m very familiar with other languages like c# and I have made it this far.
The goal if the entire code is to create a day/night cycle with a weather system using an existing skysphere and directional light source in the level. I have mostly figured it out but i can’t get it to change the material parameter collection that controls the snow and rain on textures. This will be a part of a plugin im making so i would prefer it to be c++ rather than blueprint.
It looks like you are crashing inside UWorld::GetParameterCollectionInstance. You should debug your application (use the DebugGame build configurations) and step into that function and see if a) the world is initialized properly and b) the ParameterCollectionInstances have been initialized properly
I have stepped in to the function and it appears that “this” is null, given that it’s type is a UWorld is suggesting that the world is not initializing? It shows that it is able to get my collection as the parameters are in the locals.
Since the UWorld only exists on objects which have been spawned into the world it might be that the constructor is being called for the CDO which would not be able to access a UWorld object. You can try doing a check for a valid UWorld pointer before initializing these variables.
Another possibility is moving this initialization to BeginPlay.