single collision box for multiple blueprint actors

Hi,

I followed a tutorial on creating a blueprint for a lamp, which turns on the light on when the player goes inside a box (triggered collision).

How can you make it so multiple instances of the blueprint uses a single box collision actor in the scene? (That is, all those copies of the lamp BP will turn on when you enter the collisionbox)

I’m new to BP so Im guessing the collision box is not a component in the lamp BP…? but how will it link(?) and be checked by the BP script of the lamp? sorry, noob here… Help!

One of two things

  1. Make the collision boxes of the lamps so big, they all overlap :slight_smile:

  2. When the player goes into one collision box, use ‘get all actors of class’ to find all of them lamps and call the ‘on’ event.

Thanks for the reply.

sorry could you elaborate how to use Get “all Actors of class” for this case? I sort of had it working by using a loop… but in my case the lamps are near to each other so its easy to trigger multiple trigger boxes, w/c results in the lights turning on and off… :frowning:

If the lamps aren’t dynamically instanced then I’d push the get all of class to begin play and cache it.

Second option - this could be pushed to a delegate. Have the lamps subscribe (bind) to a delegate and then just call that delegate to turn all of them on. (you won’t get the for loop performance hit)

Thanks for all the replies, guys. I’ll try them :smiley:

1 Like