This series will require no Art assets.
No previous knowledge required.
Please do comment below tell us what your thinking!
Join us on Discord!
A big thanks to all the Firebeard Family and Patrons for making me love what I do and do what I love!
So now we're going to take a look at the player's ship character.
We are going to create it using just some basic cubes.
Double Click BP_Player to open it.
You can adjust the perspective of the viewport and tool by dragging on the sidebars.
So Top Left corner Add Component.
We're going to type Cube.
This cube is a little on the big side.
we're going to constrain the proportions, so it can stay a cube and drag down the size to be a quarter.
Do this by locking that Scale of X, Y and Z.
Then click and drag on then to scale your cube up or down.
Then drag your cube up get a better placement on it.
We can adjust the speed that the Viewport moves around, like the camera we are controlling.
By holding down the Right Click and adjusting the mouse wheel, using W, A, S and D to test the speed.
We're going to duplicate this cube and put it to one side.
Once again using Copy (Ctrl + C) and Paste (Ctrl + V) for duplaction.
Then we're going to duplicate again but this time put it on the other side.
Once more duplicating the cube and placing it on top.
Once we've got these 3, it looks kinda like our Ships Character.
It's close enough for now.
We are going to group all the cubes under the Parent Block, which is the first one we created.
Now I'm going to click on the Parent Block and press F2, you can also Right Click and click rename.
We are going to call this Ship.
Now we are going to need some way of sensing when we've been hit by one of the bombs from the enemy ships.
So click Add Component and search Box Collision.
W're going to move it so it looks right.
It doesn't have to be absultly perfect, just has to be close enough.
Now we'll Compile and Save that.
What we are going to do now is create an event, Click on Event Graph
The event will tell us when the Box Collider is overlapped by another object.
Right Click on our Box Collider mine is called Box.
Move over to the Add Event tab and look for OnComponentBeginOverlap
We're going to find out what the other object was by Casting to it.
So we are going to Cast directly to the Bomb.
Drag off the Other Actor node and search for Cast to BP_Bomb.
If the cast fails it goes out the bottom node if it doesn't then it come out of the top node.
All we are going to do here is destroy the Bomb.
Drag off the node As BP_Bomb and search for Destroy Actor.
When the Bomb hits that Character, we are also going to want to destroy the Character.
So we can just Copy and Paste the Destroy Actor and leave the Target Empty.
But before we can destroy the Character we're going to need an Explosion.
So we'll have to Spawn our Explosion effect.
Drag off the Destroy Actor node and search for Spawn Actor from Class.
Click on the Class drop-down menu and choose BP_Explosion.
Now obviously, we don't actually want the Explosion to be Spawned after we destroy the object we are in, because we wouldn't know what Transform to use.
So we are going to have to move deleting the Character until after we have created our instantiated Explosion.
Now we're going to drag off Spawn Transform node and search for GetActorTransform.
That should do it.
All we need to do now is Compile and Save.