Spaceship Pawn Firing

We’re going to do input action wire. And this is going to be firing our weapon or projectile. So this is going to be casting to BP on player ship. And we’re going to get player pawn and then we’re going to cast to the Player Controller so BP Player Controller, and that one of course is going to be getting Player Controller. From the pond, we’re gonna do end of ship. And we’re gonna get world transform. Save, and then over here work for the Player Controller, we’re going to get shots to fire and drag this and to play. We actually made a new function called spawn location and fire and we’ve simplified it quite a bit. So we’re going to add a for loop. For loop, and we’re going to add the input shocks to fire and make it an integer and put it down in the last index. Then we’re going to do cast to BP player ship pawn, and again get player pawn. And then we’re going to branch out of that with end of ship. We’re going to add another for each loop. We’re going to make an array temporarily here. And then we’re going to branch that out and do component has tag and we’re going to do spawn so now make sure we compile this make sure that any air you have Your intership nested under ship, and then your spawn point, scroll down to components and make it the tag spawn here under component tags, and then that will automatically listen and then we’ll do a branch. And if it detects that this is true, it’s going to allow you to spawn actor from class and we’re going to do BP underscore laser. So now that’s gonna automatically if true spawn the BP laser but now we need to tell it where to position itself. So again, from end of shift, we’re going to do get child components and then Make array. Oh, I made a mistake here guys. So we want this. So let’s back this out and put this back in for each loop. That was my mistake. Back that out. There we go. And then we’re going to add the get world transform, break it. Make transform, we’re actually going to do scale rotation, and the patient’s going to come from another break transform which is separate. So from this loop, we’re going to go get work. Transform, grab it and then pop it up here. Save. Now if we go back to our main and try to run, there you go. So now we have a firing on our firing after class. And let’s shrink that BP laser down quite a bit. That is pretty massive. So let’s do point three. Let’s get that point three there. Try it now. Fantastic. All right, next we are going to move on to the asteroids. Actually. Next we’re gonna, Alright, great. Next we’re going to move on to building those invisible walls that will allow it to move from one side the screen to the next.