Hello,
my Question is simple, is there a way to get the object class (Object pin) to convert to an object reference with class (Return Value pin)?
I want to get a similar behavior like the Filter by Class function, but only with single objects not arrays.
Yes, this would be a solution if I only want to filter out one specific class, but I want to filter different classes. Would there be a way to always set the class I want to filter?
I’m wondering if the root of this problem, running different code depending on difference between classes, is something that could be solved using interfaces. Then you don’t care about the class.
To be clear, though, if they all have the same way of implementing damage ( in this example ), then they should use class inheritance, and you only need to check for the parent class.
and like ClockworkOcean, I do wonder what you’re wanting this utility for, there’s probably a better way to do whatever this is going to be used for
Hey, sorry for my late reply.
So I’m looking for a similar behavior like the “Filter by Class” Function from the Datasmith plugin. Here is an Overview:
On one hand, you get an Array of Object References and a class to filter, and then it returns the filtered Array with the coresponding object reference type.
I’m basically looking for a function that replicates this behavior with single objects, not Array’s.
I hope this helps you understanding what I want.
But again, I’m not sure if this is possible with simple Blueprints…
Yeah I know.
This macro, or whatever it will be, would just be way more convenient to use.
I’m mostly doing this to learn about Unreal Engine itself.
in that case I’d probably take @ClockworkOcean 's method as the “most correct.”
If you make a class reference in one blueprint, that creates hard reference to the class which can have a snowball effect of not-needed classes all getting loaded at the same time. If you start to notice blueprints taking longer to open in the editor, this is tell-tale indicator.
unreal is offering tons of ways to filter sans class reference - I imagine for this reason. Interfaces are a great way, but just one of many ways.