Download

How to Target the Stencil of Lots of Components in an Actor?

I have an actor with a lot of components. I’ve added a tag to each component called “Apple” and a single Collision Box with a “Begin Cursor Over” event. How do I set this event to execute a “Set Custom Depth Stencil Value” to each of the objects with the tag “Apple”?

I figure adding the tag “Apple” to each one will make it easier to target each component. Should I use a “ForEachLoop” with a “Componenet Has Tag” somehow? Nothing I try is working.

I’m somewhat new myself to cursor events. In order for me to get the cursor events working in my BP i had to enable the mouse over and click events in the clickable actors BP.

Clickevent.PNG

Create a variable of type “PrimitiveComponent” reference, make this an array.

Set this array in your construction script. Drag the entry pin of your “Set” node, type “Make Array”.

Plug each of the component you want to toggle the stencil of in the “Make Array” node. You can add entries in by right-clicking the node.

After that, you can loop through that array and activate / deactivate the stencil by dragging a wire out of the “ArrayElement” pin of the “ForEachLoop”.

Quote me if you want more details.

Thanks! This appears to work for me.