Can't use Cast() or dynamic_cast in this case?
Hi! I'm very new to Coding in UE so please bear with me as i feel i'm missing something terribly obvious.
I am attempting to down cast an object of mine during runtime. This object is not derived from any UE class.
From my understanding these are my hypotheses :
As RTTI is turned off in the engine, i can't use dynamic_cast. ( and i can't turn it on ? )
As i am not deriving from any UE class, my class isn't registered in the reflection system, therefore i can't use Cast(). This is for simplicity and to avoid as much overhead as i can, but if there is an efficient way of doing this i'm all ears!
My question is : am i mistaken in thinking neither option is available to me? What can i do?
The code looks something like this :
Thank you very much for your time!
You wrote: "I'm guessing i'll throw an enum into the base class, test that and static_cast accordingly."
That is a solution I've employed on multiple occasions to great effect!
I made a pure C++ UI system (not UClass) this way!
UE4 Forum Link with Videos
Pure C++ Base Class .h
you can try static_cast
answered Apr 14 '17 at 02:43 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here