Hi,
I just want to cluster some functionality away from Game Mode Blueprint to specialized components (VR Manager in this case which extends ‘script component’ (didn’t know what to use else). But I am not able to create an instance of it:
It’s value is NULL when the game starts. I don’t know how I can make my component ‘static’ so it’s code seems to need an instance to run. It don’t see a method to create an instance of it either.
How to do this correctly?
I’m not a total expert but I don’t think you can do this without c++ code.
There isn’t a way to create a non-actor (which ScriptComponent is) solely in blueprints.
If I you don’t want to go into c++, I would just make the VRManager an actor, then use the SpawnActor function.
Hope that helps.
I think you would have to use C++ to do this in that exact manner. You could either make a singleton of a blueprint that descends from Actor or even Widget, or you may be able to use a blueprint macro library to do what you need.
https://docs.unrealengine.com/latest/INT/Engine/Blueprints/UserGuide/Types/MacroLibrary/index.html
Thank you (although this really sucks…). Macro libraries can’t save their own state unfortunately.