Some times ago I created this little blueprint to allow my character to eat some fruit along a level. When colliding with another actor, the blueprint would play a sound, destroy the other actor, and call a function to increase a counter. All worked fine, until I added other kind of actors in the scene. Now this blueprint do its job no matter what is the actor colliding with my character.
&stc=1&d=1435054754
So, I think I could create a branch and depending on what kind of class the colliding actor belongs to, execute the blueprint or not… problem is, I am having trouble to get the colliding object class and connect it to the branch node… This was my idea.
Can someone help me with this please? How do I determine the class of the colliding actor? Or maybe you have another, better way, to solve this problem?
From the Other Actor on the component hit/overlap node, you could cast it to a class, if it fails, try casting to another, if it fails, cast to another, and so on. Eventually it should work on something.
It will pretty much work the same as your branch idea. Not sure if it’s the most efficient way though.
You could also create a custom object response for certain things, that way, only collision with certain objects could trigger it.