Okay, so now we do want this trigger volume to do something when we overlap it. So let's right click on this trigger volume, add an event for on component begin overlap. And the first thing as we've been doing for a lot of these is we want to check what was the thing that is overlapping this trigger volume, this box shape right there. We're going to drag a wire out of the other actor and do that cast to first person to ensure that it was a first person character that overlapped it. Then what we're going to do is drag in another reference to our standalone target. I'm just going to hold down Ctrl and left click to bring in a getter right away.
In out of it, I will drag out a wire Find a branch. And if this is labeled as a standalone target I want to do once right there. And what do I want to do, I want to basically find our targets, our point value, and our spotlights. And I want to drag a wire on any one of those and I want to set visibility. Plug all three of these into the target and make sure that you check this new visibility box. So again, what we're saying here is, as soon as we do overlap this trigger volume, we do want to show the target the point value in the spotlight Now, one thing I want to make clear is I know there right now this trigger volume that we're asking the point The overlap is kind of overlapping our target here.
Isn't that a little weird, Mr. quandra? I mean, like, what if this targets way up in the air? How's the player ever going to overlap that? Well, once we place these in the level, we will be able to move this trigger volume independently of the rest of this blueprint. So just know that we can move this box down into the right any place we want to put it. Okay, so let's continue on here.
So we're setting that visibility to be true. Next, let's get our target collision. Let's talk to that guy. And let's do set collision enabled. And for the collision type, let's set it to be query only. That'll enable some collision.
And continuing on what do we want to do next we are going to bring out a something called a sequence node. Drag we're out of here sequence Because we're going to have two things that we want to do, and I'm gonna break, I'm gonna branch off this top, then one first, and then we'll deal with this a little later. So the first thing I want to do is I want to let's play a sound, play a sound 2d, and the sound that I want is called possess, possess player Q. That's a nice sort of spani sound effect. And then I'm gonna want to plug this into a timeline. So go ahead and find a timeline node.
And let's call this timeline spawn. Animation, we're going to play a really short spawn animation for when the target pops into existence. We will deal with this in just a little bit. Actually, you know what, let's deal with it now. So let's back this up. up again real quickly.
Player overlaps that trigger volume we are checking again isn't labeled as a standalone target. If it is we want to one time set the visibility of our target point value in spotlight to be true. turn our target collision on so we can now shoot the target. Then we're going to play that spawning sound effect and we want to do a spawn animation. Let's double click on this guy and create a spawn animation. Okay, we're going to have a relatively short animation here.
Let's go with the length of point three seconds. We will be creating a float track. Let's name it. rotation. And let's add let's add three keys in here. So I'm going to hold down the shift key and left click Once left click twice and left click a third time.
And note that I don't really care where I place these keys here to begin with because I am going to be manually setting them. So I'm going to select this first key and I'm going to give it a time of zero and a value of zero. Selecting our second key, I will give it a time of point one five seconds and a value of 1.5. And then I will select our third key here. Set the time to be whoops, set the time to be point three and the value to be one. And let me just hold down Control and use my mouse wheel to scroll way back and we're going to left click drag on a marquee selection to select all those keys and click on these two arrows to frame that into view.
Then with all those selected, I'm also going to right click on any of these keys and set my key interpolation to be auto. That's going to create this sort of smooth animation of a target kind of spinning into existence that I will demo for you when we're just about done here. Okay, so let's hop on back to our Event Graph. And now we've got this rotational float value that we can pull out of. But first, before we even deal with that, let's talk to the thing that we actually want to animate here. And that's going to be our target collision.
And why do we want to animate this thing, because all of these guys are attached to it. So if we animate this kind of spin it into into existence, all these are going to come along for the ride. So I'm just gonna left click and drag drag this out here. And then I am going to drag out a wire here and do sets, sets relative. You know what, let's scale the size of this target. Let's make that the animation I was going to kind of rotate it into existence.
But you know what I think I'm going to scale it into existence instead. So let's come back in our spawn animation and let's change this instead of saying rotation. let's right click this and rename this to scale. I think that's what I was intending all along, but I messed up in my notes here, so bear with me, we're gonna scale that. So then out of our target collision, let's just left click and drag and let's do a search for a set, relative scale 3d. And what if we could plug this in right away, but I don't want to do that just yet, there is a safety check I want to do there.
Let's just take our scale and plug this right into our new scale 3d. So it's gonna bring in this little conversion node. And basically that scale is going to get applied to the X, Y, and Z of the new scale 3d. So we're going to essentially scale our collision or our target from a point of nothing to something a little bit bigger and then shrink it back down again. Between these two, what I want to do is I want to drag out or actually it's right click and bring in a reference to self. We want to talk to ourselves.
Don't we always out of this, I'm going to drag out a wire and do a story. For is a valid and there's two different nodes here you want to choose the one with the question mark. And the way we're going to hook this up is on our update, we are going to plug this into here and out of the is valid. We are going to plug this into here, let's understand what we're doing. We have this spawn animation that is going to take point three seconds and it's going to essentially scale the size of our target from basically an infinitely small point to target one and a half times its normal size and back to a relatively normal size. During that time a player could technically shoot the target.
If this is not in here, you're going to get some warnings yelling at you saying hey we could not find the target collision because you have already destroyed this target. So know that this is a safety check to save you from Some errors later on. Okay, so that's all we want to do out of this top sequence branch. Let's pull out of the bottom portion of the sequence branch. And I want to start by bringing a wire out of the then one and let's do a search for a delay node. And I want to set our delay to be the time that is contained within our lifetime variable.
Because what we are going to do here is drag out another wire bringing another sequence node and onto the top, then zero. I'm gonna plug this into the reverse of our spawn animation. And don't worry, I'll come back and explain that in just a moment. And then I'll get out of the ventilator. One I'm going to drag a wire out, set a another delay 4.3 seconds to 0.3 seconds. And then we are going to destroy the actor which is the target.
Now a few things I want to point out what we're doing here let's in fact let's back this all the way up. Upon overlapping a trigger volume we're going to check if it's the first person character We're then going to ask was this a standalone target was that target labeled as a standalone target? If it was one time, we want to set the visibility of our target our point value in our spotlight to show to be visible. We're also going to make it so that we can actually shoot the target by enabling some collision. Then we are going to play a sound effect, a spawning sound effect the spawn animal Which is 0.3 seconds we'll play. First we'll check to make sure that the target has not already been destroyed because its spawn animation is 0.3 seconds.
And over the course of 0.3 seconds we are going to scale the size of our target collision, which is the parent of everything else here. So it will scale it from basically a scale size of zero, up to one and a half times its size and then down to it's 100% its normal size. And while we are playing the spawn animation, we are then beginning a countdown, a 10 second countdown in this case our lifetime and after this delay of 10 seconds happens what we are going to do is reverse our spawn animation. And after this same time of reversing our spawn animation 0.3 seconds We are going to destroy the actor. Hopefully that all makes sense. Let's Compile and Save.
And then let's come over into the level editor and give this a whirl. Now I should be able to drag in any one of our targets here because remember, they're all children of our BP target parent. I'll start with BP target 100. Drag that guy in. And notice with it selected over in the Details panel, you see fields to customize how many points it's worth, the lifetime that it will stay active or alive. And if it is a standalone target, I do want to check this by checking this remember our script is saying it will not be visible at the outset of a level.
Let me just drag this up into the air a little bit. I'm going to pivot this around. We're going to put this to the test right away. Kinda In the error over here. Now notice, with this selected in the Details panel, if you kind of drag this portion of the Details panel down, it's a little hidden, you can reveal all of the components of that blueprint. And this is where the magic really happens, you can select your trigger volume.
And just with the trigger volume selected, you can move that one component around into your level wherever you want it. So I'm going to set this down on the ground, I'm going to scale it a little bit to make it easy for our player to overlap it. And then I'm going to pull it way back here. Right about there, so that when our player starts in the beginning of the level, he's going to come down this alleyway is going to overlap this and as soon as he overlaps this volume, look right in this area because this should spawn in. Now remember, I've got this set to spawn. Let me just select my target here, it's supposed to stay alive for 10 seconds and go away now, I can actually shoot it and destroy it just yet that script is to come.
But let me set my lifetime here to be five seconds because that's all we need to see it go away. Alright, let's jump in and play and see well we got you have to open F to open. A little damage now watch right about there. Boom, target comes into existence. Five seconds pass cannot shoot it yet. then boom, it goes away.
Everything Is Working superbly awesome. In the next one, we will actually script some more functionality for our parents target so that all the children can inherit from it, so that target can be destroyed. We will see you guys in the next video.