[C++] How to get a reference to a class in the scene within another class
Right, so coming from Unity, you could literally make a public reference and drag it in, or a private reference and use getcomponent.
However, Unreal seems to be super confusing and there is no obvious way to do it that i have found.
I am trying to access my class "ALevelGenerator" in my Gamemode. Through this code:
.h public: class ALevelGenerator* LevelCreator;
.cpp in constructor LevelCreator = Cast(GetComponentByClass(ALevelGenerator::StaticClass()));
P.S i have the file #included too. This does not compile. Any ideas?
asked Sep 26 '16 at 01:27 PM in C++ Programming
Follow this question
Once you sign in you will be able to subscribe for any updates here