Hi, I am a very new learner, so I am sorry in advance. I am currently following along a tutorial and am confused
Here, the pawn class is called Collider. Is it okay for you to declare and initialize a static variable of type FObjectFinder inside a constructor? Would that not defeat the purpose of it being static (not related to any instance of Collider)? Also, out of curiousity, I was trying to declare a static class member of type FObjectFinder in my Collider.h file, before initializing it in Collider.cpp file (just like how you declare and initialize static class members in normal C++)
In my header file:
In my cpp file
However, it said that the class member is not found. It seems that the error is solved if I include #include “UObject/ConstructorHelpers.h” in the header file. However, this crashes my UE and it refuses to open. My question is simply then: how would I declare and initialize a static class member of type FObjectFinder? What is the code and includes for both .h and .cpp files? Thanks in advance!