Building the UFO

Welcome back. And today we’re going to be working on building the UFO. So the first thing we’re going to want to do is actually take that asteroid pawn, and we’re going to duplicate that because we’re going to use a lot of the same functionality. So we’re just going to call it BP underscore UFO. And we’re gonna open it up, and we’re gonna change asteroid to the low poly UFO body, and we’re gonna duplicate that and we’re going to create another part of it. So let’s see. Want to do why is it loading the wrong Oh, okay. Excellent. And we’re going to scale this down to one and we’re going to add in. Oh, you UFO texture That one and we’re gonna make this the low poly UFO cockpit. And this is gonna sit on top of our UFO which. Okay, so let’s make a couple changes here. So we’re slug Static Mesh, we’re actually going to get rid of this. And we’re going to get rid of the material and let’s go back to our Construction Script. Remove that. And that should be good there. Okay, go back to the viewport. Excellent. Now we have that set in stone. We’re going to add Next add in an arrow actually, we’re going to take from our spaceship, here, whoops, go to blueprints, and then our BP underscore spaceship. We’re going to take the arrow through the spawn point, because we’re going to be having this fire at us and have One point arrow goes inside. Make sure that that lines up correctly. It does not. So let’s take a look here what’s missing. So we have asteroid one. Let’s break that out. Okay. And of ship is actually going to be negative 100. So it’s closer and we’re going to make that for a little bit skilled and better. Our spawn point is actually going to be point 025 all across. Negative 90 zero 90 000 and that’ll be where it’s firing from. And then let’s fix our arrow, right arrow is definitely not in the right spot. It’s going to have a length of, let’s say seven. And where did it go? All the way down there. Interesting. Let’s bring that back. Excellent. So not sure why it’s coming out so far, but we can shrink that if we’d wanted to. But since we’re not gonna be actually visually looking at it, it’s not a problem. So our asteroid here, we’re gonna name this UFO body. UFO pocket. Let’s figure out why. There we go. Excellent. One second I have a cat in my way. There we go now he’s out of the way. Okay, so we’re going to pile and save and let’s open up the Event Graph. Let’s make some changes here because we’re not going to keep everything the same way it was so under Event Graph we are going to cast to BP laser that’s fine. straight after all this is good. Assuming we want to keep the same points you can definitely change that if you like. We’re gonna do we are not going to have it spawn twice. So let’s do this. delete these. We don’t need it to spawn twice and we’re just gonna have it spawn collectable this way. Excellent. Let’s double check. Your BP explosion. Okay, great. All right, save. And then we’re going to add in the Event Graph, we’re going to add a collision sphere. So the way instead of us having to build a blueprint character that listens like behaves like regular traditional AI, we’re gonna cheat it a little bit. So let’s do this. And then we’re going to make the sphere size 900. And what’s going to happen is when your spaceship gets close to it, and triggers either overlaps or hits it, it’s going to cause the ship to fire at directly at the enemy. So it’s going to have some slight delay, so it’s never gonna be perfect but this is a quick solution to getting some Fake AI. So let’s go down here. Let’s make sure simulate generation, we’re going to make it a custom. We’re going to do world dynamic but we’re going to ignore all except pawn. pawn true. So it’s going to trigger on pawn. And then we’re going down here on component hit, and on component begin overlap and we’re going to tell it to cast your BP player, ship pawn. Player pawn. drag it over here because we want it to work the same. And then we’re going to do some, a little bit of set actor rotation, we’re going to tell it to rotate and look towards the character and then spawn location spawn location UFO and we’re missing that I accidentally deleted that, didn’t I? Yes I did. Okay, so if we go back here and we look at Oh no, I never deleted it. Okay, we do need to make it. It’s actually inside the Level Blueprint so go to main. Save open Level Blueprint get spawn projectile location, we’re just going to copy this. We’re going to bring it over to the UFO make new construction script and call it on location of projectile UFO paste shots fire actually probably don’t need this but I’m just gonna include it for now. It’s not going to hurt anything. And then we’re going to change this to BP laser to which we have not made. So let’s make that blueprints. let’s duplicate BP laser one. And let’s just change the way it looks. Let’s see, do we have another type of laser material that we can use? Pretty sure if there is one in the default to underscore core, no. laser pointer core, here we go. Excellent. So we’re gonna Have a little bit of a different design. And we’re going to go back to our BP UFO. And do BP laser underscore for BP underscore laser one. And that will now tell it to fire at the standard projectile of end of ships or spawn points and fire from the spawn point. And we’re going to set up the logic here to set the actor location now. So let’s set this to spawn. Location of projectile UFO. And then we’re going to do get actor rotation. Find look at rotation. Plug that in here. We’re not set this delta to let’s benteke time And then turps speed. We can leave it at point 02. And then we’re going to do get actor location. And that’s gonna be our beginning and then we’re going to tell it to look at that actor location from our pawn here. Get actor location. All right, the rotation, tell them to fire once it’s found the location and let’s try this out. So, we also need to tell it now to spawn. UFO. UFO. So, again, same same logic here except we’re going to change This to BP underscore UFO BP underscore UFO I’ll save and then we need to go in. I believe it’s our Event Graph and create a new timer. Call this one spawn UFO. Now we have our UFO popping in. Except now he’s rotating a little funky. That’s not what we wanted. So, if you noticed, and the right here the rotation rate in your Construction Script for the UFO, we actually don’t want that because we don’t want it to have a role whatsoever. So we don’t want that that’d be activated. So let’s remove that. And then let’s hit play, and I believe it’s not going to fire yet. But you can see it kind of floating around and doing its own little thing. And it’s fully destructible as expected. So excellent. All right. So we had a very strange issue. So I ended up having to re add that sphere back and let’s just finish That logic up. So on component hits, cast. Excellent. Get rid of that. And if we turn on the arrow, we want to see if it’s actually looking at us correctly and rotating. We’re going to want to make sure that the set actor rotation is re enabled again. And then we’re going to go here to spawn location of projectile UFO. And we want to make sure everything here is loading appropriately. So if we hit play, and I’ll show you what I mean, if we hit play right now Ah, actually, we don’t even need to hit play. I just figured out the issue. So if you look here, the tag spawn one is incorrect. It’s supposed to be just bond because it’s looking for this bond. So if we hit play now Ah, let’s launch it from the wrong piece. Ah, silly me guys. silly silly silly me. So when I initially wanted to copy in this I realized I’m doing player ship pawn instead of casting UFO. Or, actually we don’t even need to do cast if we really don’t want to. We can just do and ship target target manta ray, loop body and presto. Now if we go here it’s firing and as I said it’s not going to be perfect. The main reason is because If you look, the rotation is doing the rotation based on the last time you targeted. So as it comes in to play, it’s gonna fire and then it’s gonna update itself looks. So let’s go ahead and increase that us speed a little bit. So interp speed, delta time, let’s do point 01 second and let’s see if that updates a little bit more frequently. And if you want, you can cheat it a little bit more. And we can actually go to sphere and do an overlap. We can do a couple things here, but we’re essentially just cheating the system. Instead of building an actual AI navigation and pawn sensing, there’s really no need to at this point, we just want to do some simple and there you have it, everyone. That is concludes the tutorial.