Welcome back, My favorite game developers.
In this video, we've created an extra set of weapons.
We've created a rifle,
and we've created a pistol.
So now when we run the game,
we are not only limited to the shotgun,
but we can also find a pistol.
Obviously the bullets are also different.
The firing rate is different.
The, even the damage that
the bullets deal and
the speed of each bullet is different.
So as you can see right here,
I can turn on the rifle,
turn off the pistol, run.
Oops. So that was a huge mistake.
Sorry for that. And turn off the pistol,
turn on the rifle,
and I can start shooting.
And as you can see, the bullets of
the rifle or a bit faster,
they are a bit greener and let's not waste any more time.
And let's get started.
Oh, case.
So Nile, It's time to add a couple of more weapons.
How are we going to do this?
So we already have the prefab for the shotgun.
So I'm going to go into
the prefrontal so we don't
have a prefab for the shotgun specifically,
we only have for the doomed player which has a shop.
So I'm going to create a new folder in here,
which is going to be called the weapons.
And I'm going to drag the shotgun in here.
Okay, so we need to open the prefab. There we go.
So now we can double-click and the drag and the shotgun.
So now we have a shotgun as
a prefab separately from the deuterium.
And you can see how the Square became a bit more blue.
Now I can add the shotgun and here and we have
the weapon that we are going to
adjust and create something different front.
So first things first,
we'll need to change this pride.
So let's go into the Whereas the sprites that we add,
all of the weapons or blood,
bullets, enemies, player tile guns.
Okay, so we only have one gun.
Let's go to the Resources 0 case.
So let's see what we have in here.
As you can see, I've provided you with a lot of things.
One of them is the animation for different kinds of gun.
And you can see we also have
the muzzle fire, muzzle smoke.
I recommended to try to add all of these.
We might also do this in a bit,
but for now we want to just have the basic concept.
We are not very looking into how pretty the,
the shooting is, although it is
important when it comes to a game.
But anyways, we have this rifle right here,
we have this sniper,
and we also have the little gun.
So I'm going to select all three and I'm going to
drag them into the guns sprite and add them.
Okay, great. Now that we have the shotgun,
let's rename it to the rifle.
A rifle.
And if I open it up,
you can see the fire point right here.
But before we do that,
we want to change this pride.
And for the rifle you can see that it's very small,
so we made them 42.
Let's select these and make them all
40 to apply the changes.
There we go, we have our rifle.
Now because of the coloring of the background,
you can see the rifle isn't
that prevalent, Let's call that.
It's not that good looking,
but let's not worry about that as
long as there and once it's on the PLR,
I'm sure it will look a bit better.
So anyways, let's continue one,
What else do we have defined between shots,
obviously, for a rifle and it's not a rifle,
it's an assault rifle, so it's automatic.
It's going to be a lot less.
So I'm going to make it around 0.3.
And let's see, the firing point obviously needs
to change so you can see where the muscle is right now.
I'm going to move it right here.
And what else do we have?
If I click on the rifle?
There we go, we can see everything is good.
What else do we need to change?
Oh, we also want to change the bullet
that it fires so we don't want to
have the same bullet as the shotgun.
And I'm going to go again into the Prefabs,
go to the bullets.
Let's find the, okay,
so the player bullet,
I'm going to change this from player bullet
to shot gun bullet.
And I'm going to go ahead and add in our world.
And I'm going to duplicate the shot gun bullet.
I'm going to call it the rifle bullet.
And this rifle bullet will have almost everything,
has the same may be the speed
should be able to better a bit more.
So let's say the speed is maybe six, I don't know.
The damage amount, maybe should be less.
So for example, let's say the damage amount is five.
And what else do we need to
change in here, maybe the sprite.
So let's look at the bullets price that we have.
We are using currently the 14.
And maybe for a rifle we can use one of the shorter ones.
So let's see, let's use the little green one.
So the little green one,
this is the one we're going to use,
whereas the rifle bullet,
let's add the little green one.
Okay.
So that didn't work.
Why? Because of that did
work but we didn't see the shotgun bullet.
Anyways, let's remove the Republican bullet.
And this will be our rifle bullet.
There we go.
It is a pretty small I
feel was there something also the scale 0.5?
And let's make it one.
Keep it as it is.
Okay, great.
So now we have this rifle bullet.
I'm going to go into the rifle and I'm going
to assign it a shot gun bullet,
but the rifle bullet.
But before I do that,
we need to prefab everything.
So I'm going to go back into the Prefabs,
go to the bullets, and add the bullet.
And it will ask me,
would you like to create
a new or original or variant of the prefab?
If I click two for the prefab variant,
this one will change,
but I'm going to create an original prefab.
I'm also going to go into the Prefabs,
the guns, weapons, where are they?
And I'm going to drag in the rifle also.
So now we have a shotgun and an original rifle.
And in this rifle, instead of using the shotgun bullet,
I'm going to go into that slot this down,
go into the bullets at the rifle bullet,
save all of that.
And finally, we are going to delete the rifle.
Delete the rifle bullet.
All go to the where is it?
Prefabs.
Okay, So weapons, it's the last one.
And I'm going to add the rifle as
the child of the weapons on.
And obviously the rifles position should be set to 0.
Now let's try this again one more time.
Again, we add the rifle as the weapons are,
and we will turn off the shotgun.
Great. So now we have the rifle and arms,
and as you can see,
it's not positioned perfectly.
What we can do is we can move it from the prefab.
You might be thinking, why is it not positioned to write?
Well, if we go back into resources right here,
you can see, if you look closely that
the shotgun spray can see where it ends.
The rifle has a bit of space in the front and the back.
So this is just a technicality
and if you add this one for example,
it will be even farther.
So what I'm going to do is I'm simply going
to maybe move this in the x-direction a bit.
So there we go around zero-point
40 to copy this and add it to the rifle prefab.
So now when I turn off the rifle,
Let's try this again,
added to the weapons on the go at fits perfectly.
So remove this.
Turn on the rifle.
We have the firing point,
we have the rifle bullets,
we have everything set properly.
Let's test this out,
save that, run the game.
Let's make this a bit bigger.
Okay, so there we go. Yep, there we go.
You can see right now that we have the shotgun,
not the shotgun, excuse me,
the actually let's maximize on
play the game to see it properly.
There we go. So now when should the bullets,
they are much faster and
the time between shots is much better.
There we go. How cool is that?
Don they look really nice?
Maybe we should make their damage a bit less,
but didn't make sure if the damage was working correctly.
And you can see it turns around and does everything
the shotgun was doing and it was pretty easy to create.
So with that, I'm going to issue you
a challenge and it is to add your own weapons.
So create one or two more weapons of your own choosing.
I'm going to add a pistol.
It's, everything will be the same just like I showed.
I will create a different bullet for it and etc.
So maybe you've downloaded some weapons,
sprites of futuristic weapons.
And I really wanted to do that,
but I didn't find a really nice set of futuristic opens,
all the sprites where either you had to
pay for them or they weren't that good.
And I wanted to make sure that this all end.
All of my courses of the assets
that we use are 100% free.
And finally, at least one more weapon,
or add at least one more weapon with its own attributes.
So pause the video right now,
go do the challenge in the next video, maybe right now,
I'll just use the magic of editing,
create the weapon you've seen the process,
you don't have to see her again,
but I do recommend that you add your own weapons.
Trusting it is much more fun to have weapons that
you've created and not just things that you copy from me.
So that said I'll see you in just a bit.
Okay, welcome back.
So I've added a pistol and
I just had a couple of wacky things I wanted to create.
You can see, so I've
made a stall with a time between shots.
I've made a pistol bullet.
It's not a perfect crystal bullet.
It's kind of big, honestly,
when it comes to the way
the pistol works or the size of the pistol.
But let's not worry about that.
This game is all about creativity and having fun.
So whatever you wanna do,
just make it. So there you go.
You can see the little pustule.
It moves around and when we should book, there we go.
And you can see that the bullet is kind of big,
but I really think it is really nice.
So it will at least differentiate between
the regular bullets of the shotgun and
the bullets of the rifle.
So you'll know that this is a pistol
and this is the bullet of the piston.
So with that done, I hope you enjoy it.
I hope you created your own weapons.
And if you haven't already leave me a review,
it helps me out a lot.
Make sure to commit your changes.
There we go.
Created a salt salt rifle
and a pistol as extra weapons.
So please make sure to leave me a review.
It helps me out a ton and I'll see you in
the next video where we will be
actually switching between our weapons.
As you can see, we have to turn on and off
certain weapons and we can even turn on to weapons,
which is a cool mechanic,
but not one that we are looking to do,
especially when it's not in our control.
So I'll see you in the next video.