Probably a noob question by a noob!
I am trying to set up a simple interactive archviz style UI in blueprints. It is working but I am not happy with the implementation as it seems horribly inefficient,
I have a line-trace using a custom coillision channel attached to my character that fires every 0.1s on a timer and sends valid hit objects (of unspecified type) to a handler…thus…I have created a blueprint parent class handler that receives a reference object from the trace stored as a local variable and has basic common functionality I want available to all my interaction items, which are then all subclasses of this handler class. (such as chair, table, door)
Each subclassed actor can then have a different set of interaction widgets, but as these all have some basic common functionality, I have a parent widget which contains only common interaction functions (ie key press defaults) , which is then subclassed to provide more specific design element UI (texts, buttons, sliders) unique to the object in question.
When the object reference is sent to the actor subclasses from the trace, I then load up an assigned widget subclass and pass it the object reference so it can display some basic data like the name of the object, which can be achieved using <get display name>, but for the life of me, I cant get the type of subclass actor from the hit object reference even if I cast to my parent actor class.
Surely there is some way to asses what type of subclass the reference object contains?
Im thinking of functions in other languages such as isA, or isInstance of
Also if I pass the referrnce object, why do I have to still cast to my subclass actor and run a select all actors in scene to get the specific actor…surely the reference object can only ever be one of these subcasssed actors, but I cant get to it any other way than setting an isActive flag on the parent class and checking for this over every object in the scene.
Seems ineffiecent, and has potential for a nasty bug if more than one actor is ever active (although I have taken steps to ensure this cant happen)