How to effect a whole class, not just instances?

Hello all,

I’m trying to work out how to have my 2D character collide with some objects. Basically, I need every instance of a class to activate collision on my command, and to deactivate collision on another command. I have the collision working the way I want for individual instances, but I need a way to make very instance do this. I’ve been trying to use the “get all actors of class” node to return an array, and then a “for each loop” node, but it doesn’t seem to work.

(note: the “solid” variable is used to turn collision on and off in the class’s blueprint)

Any help on this would be greatly appreciated. Thanks.

Did you check to make sure the EndOverlap event fired? Also did you make sure that you have got all the instance of the class?

Hi CKong,

Thanks for your reply. I did check all of those and they were working, but I decided that I would give up on trying to do this. I’ve found another workaround which is a bit time-consuming but it seems to do the trick. Thanks anyway.

You can create a custom event to change the collision settings. The custom event you create can be fired after the get all actors of class node. Setting the solid variable by itself wouldn’t change the collision settings. You should use a “set collision enabled” and perhaps a “set collision profile” node.