Noob BP question. If I have a BP hidden at begin play. the BP is a couchset with alot of components like chairs, table , lights, all in 1 BP. but I want to unhide the BP when the player overlaps a triggerbox, how can I code that in the Triggerbox BP. I created a On Component Begin overlap node. Then I’ve put down node Get All Actors of Class and reference my Couchset BP by creating a variable and changing it to BP object reference? This doesnt work for me. I;ve also tried to Set Actor Hidden in Game node and made false and referenced the BP, but still nothing happens when I cross the triggerbox. Any help would be great, thanks.
No no
Don’t try and hide / unhide everything, use ‘actor hidden in game’, that way you can do it all at once
This is IN the blueprint. And before you start
Hi, I have the BP actor hidden in game already like above. So when I start the level the BP Actor is hidden in an empty room. I walk into the empty room and I want the BP Actor to appear, to unhide. Could you let me know what that looks like in BP, thanks
Assuming it has a collision box in the BP, just that code above. That’s it
Rather than having a separate actor with the chairs, table and so on… make the Trigger Box also a component of the actor that has the furniture. Then there’s no worrying about the comms, the above example will work and the actor becomes reusable, too.
put down node Get All Actors of Class and reference my Couchset BP by creating a variable and changing it to BP object reference
Does not sound like a good tool for the job. Why complicate things:
You can move those elements freely in the scene - position the (trigger) box where needed.
And if you need to have the trigger and the actor separate (because you may want to for numerous good reasons!), use the LB - that’s what it’s for:
- RMB the trigger and add an event:
- you can reference actors in the LB by dragging them there from the World Outliner, or by selecting them in the world and right clicking in the graph:
And, finally, should you need a single trigger affect many specific actors, you can gather them in an array in the LB. Create an array variable and add what is needed:
If you asked me, there are too many ways to pick and reference actors, tbh… You can drag & drop them into arrays:
Or use the pipette, or even reference assets from the Content Browser. Also, actors with exposed variables can reference other actors directly.
No. Not for this, at least. All of the above are working examples that address what’s in the original post. You enter a trigger and actors appear. No need to make a tangle of wires for something like that.
Ok let me try this, thanks again for the help
And lastly-lasty (pinky swear!)
- in the LB:
- in the furniture actor:
The benefits here are:
- a looser coupling, if one of those actors gets destroyed, you will have no errors thrown in your face
- it’s dynamic, you can unbind, rebind, add more delegates
- it’s somewhat type-agnostic, you can communicate with actors of unrelated classes in the same way for as long as the event signature is matching:
There’s probably more ways to do it all but Get All Actors of Class
would be outside the list of tools I’d consider for this job.
Happy Wednesday, y’all