I’m trying to create a trace to an object and check if it’s a certain type of object via a variable. But the problem I see occurring is things going haywire if I define a class type to select, and then when tracing to an object with an invalid class type, it’s going to glitch out really badly or even may be even crash. Probably not, but I’d rather be cautious.
Is there any way I can create a pointer to a class/object without defining the class type in the pointer? I’m having to define AActor* or UClass* which I don’t really want to and doesn’t exactly work for me. Specifying the type of the object I want to select however, again, could cause issues in the code.
On top of that, I need to be able to check if the class/object I’m selecting has a property and if that property has a certain value. Checking for value doesn’t seem to be possible as VS instantly errors things out for me saying that AActor or UClass doesn’t have the specified property type, so is what I’m trying to achieve even possible to do? Or is the error type of “pointer to incomplete class type not allowed” indicate exactly the fact that this is not possible? In which case, how could I handle this?
I found IsA() function, which could work for checking class type, but it doesn’t seem to like to take a variable as a value and the documentation for this function doesn’t tell me anything at all.
If you need more info on this, do let me know and I’ll try to provide it.