Hi, I have a blueprint which uses a collision box to trigger audio using ‘On component begin overlap (box)’, the audio is the stopped when the player leaves the collision box by using the 'on component end overlap (box). All this is working fine.
I’ve created an actor (object reference) variable where the user can select an actor from the level in the editors details panel for my blueprint. I want to use this selected actor as an alternative method to stop the audio… i.e. when the player overlaps this actor then I run the stop audio logic.
I can’t figure out how this is done, I’ve been on chat gpt for hours running around in circles, it’s telling to connect nodes that can’t be connected, or to search for nodes that don’t exist! Just about losing the will to live!
I’m sure this is probably fairly simple, but I’ve no clue, I’m still learning loads about blueprints so my knowledge isn’t vast in this area.
What’s the actor gonna be though? You can either select it from an array of actors (which you can store them inside with multiple ways, casting for example) if you already have your selectable actors in the scene, or if the selection occurs on a line trace / collision you can reference the hit actor, or if the selectable actors are not yet in the scene you can spawn it and use it as the reference.
And you can use an Actor Begin Overlap node inside your selectable actor(s) to trigger whatever you want.
The trigger actor will most likely be a static mesh, but something that might not be added to the scene until it’s needed, not something spawned but rather something the user manually places in the level for use as a trigger
That’s what the Spawn Actor node does. If you want to store your variable with the selected actor, you can just use the node’s return value. But now that your objective is a little clearer, currently there isn’t even a need to store the actor!
You can just trigger whatever you like after the Actor Begin Overlap node inside your selectable actor’s Event Graph. And that should be it. After it’s spawned, you can walk up to it and it’ll trigger whatever’s placed after the begin overlap node
Hmm… I’m even more confused to be honest, it’s been a long day and my brain is tired an not working… lol
Let me give you a case scenario…
Someone’s building a level, they add my blueprint to the level that triggers audio when the player enters the collision box of the blue print (the blueprint does a lot of other things besides this), currently when the player leaves the collision box it stops the audio, but I want to add the option so that the audio can be stopped by another actor that the person building the level choses to use. i.e. they might have a door in their level that they want to use to stop the audio, or they might want to add an actor to the level that can trigger the audio to stop.
I finally figured this out, all I had to do was select the actor variable, in the detail panel on the right hand side, there’s a list of events at the bottom that you can add, I added ‘on actor hit’ and it added a on actor hit node that I could connect my logic to. This is probably basic stuff to more advanced users, but if you don’t know, you don’t know.