the set and select weapons methods, the way you have them match up with the array index, ..... is nuts. i really like that. and the true false check for switching based on that. really nice. Line 39 is my favorite. 2:28
Its so funy that I was watching Unity Basic Weapon System Tutorial from this guy and was have problems with the shooting accuracy and some how ended up clicking on this video.
Great video as always! Btw I personally believe firing from muzzle can also be quite useful for building realistic FPS game where where the gun is pointing matters.
i wanna make a cool switching animation, but this script makes it very so theres multiple ways to make it, example: ... well, idk how to make that stuff i gotta learn more :/(oh yea and also, good job viber, very usefull... and cool)
Hey you guys seem to know alot about this crap. Everytime I try to reload my ar the console says "coroutine couldn't be started because the game object "pistol" is inactive" and vice versa. How do I fix this?
your tutorials are simple af. i have learned so much from one of your videos, and im about to watch all your tutorials. i have a project for 27th of march and i have to make a decent game and the map is my college, and i have 11 days to make it, im learning at the moment. keep up the good work, i think i will make it in time by watching your tutorials
Is there a clever way of making weapons "unlockable" with this system? As in you can't equip a weapon until a condition is met, like the player having picked it up for instance
Hey, im a bit dense so i might just be blind to a step, but if i interrupt the reloading by ending playtest during the reload, it just breaks the gun, it can't shoot or reload anymore and i have no clue why or how to prevent it from happening, i just reload a backup to fix it. wut
whenever i load another scene it says, "MissingReferenceException: The object of type 'Transform' has been destroyed but you are still trying to access it" can u please help?
Very useful tutorial, could you please add weapon pickups next? I wonder how to make this script check if weapon is picked up and therefore determine to activate it
Please make another tutorial on adding particles to your guns when you shoot them and aiming down sight or even crouching and jumping im enjoying this alot please pick this tutorial back up
It already is, the first part where hes setting up the weapon and already has a FPS controller -- that controller is the one he built or at least similar enough to use this on it.
Hi, I don't know if you still read comments but when I switch weapons then fire it fires the current weapon as well as all the ones selected since last shot fired. Is there a fix for this?
well, i'm a bit late to this but here's the solution (paste this inside the Weapon switching script): private void Update() { int previousSelectedWeapon = selectedWeapon; for (int i = 0; i < keys.Length; i++) { if (Input.GetKeyDown(keys[i]) && timeSinceLastSwitch >= switchTime) { // Unsubscribe the event listeners of the previously selected weapon if (previousSelectedWeapon >= 0 && previousSelectedWeapon < weapons.Length) { PlayerShoot.shootInput -= weapons[previousSelectedWeapon].GetComponent().Shoot; PlayerShoot.reloadInput -= weapons[previousSelectedWeapon].GetComponent().StartReload; } selectedWeapon = i; // Subscribe the event listeners of the newly selected weapon if (selectedWeapon >= 0 && selectedWeapon < weapons.Length) { PlayerShoot.shootInput += weapons[selectedWeapon].GetComponent().Shoot; PlayerShoot.reloadInput += weapons[selectedWeapon].GetComponent().StartReload; } } } if (previousSelectedWeapon != selectedWeapon) { Select(selectedWeapon); } timeSinceLastSwitch += Time.deltaTime; }
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using TMPro; public class AmmoCounter : MonoBehaviour { public GameObject WEAPON1; public GameObject WEAPON2; [SerializeField] private GunData gunData; [SerializeField] private GunData gunData2; [SerializeField] private TextMeshProUGUI ammoCounter; private void Update() { if (WEAPON1.activeInHierarchy == true) { ammoCounter.text = gunData.currentAmmo + "/" + gunData.magSize; } if (WEAPON2.activeInHierarchy == true) { ammoCounter.text = gunData2.currentAmmo + "/" + gunData2.magSize; } } } Make a canvas and add a TextMeshPro. After that, add the script to it and add the gun datas and gameobject.
Any tips on how to go about implementing bullet tracers like this ua-cam.com/video/cI3E7_f74MA/v-deo.html as the Raycast is now done from the camera and not the muzzle?
keep the muzzle object and raycast the shot from camera but draw a tracer line from the muzzle to wherever your camera raycast hits? I haven't worked with this but it's a thought that popped into my head. May not be viable.
Your code is literally impossible to follow because you autofill so much and use curly brackets so bizzarely. it's like trying to follow a monkey on speed.
the set and select weapons methods, the way you have them match up with the array index, ..... is nuts. i really like that. and the true false check for switching based on that. really nice. Line 39 is my favorite. 2:28
Its so funy that I was watching Unity Basic Weapon System Tutorial from this guy and was have problems with the shooting accuracy and some how ended up clicking on this video.
Awesome VDO Father (Plai's child as you know me)
Great video as always! Btw I personally believe firing from muzzle can also be quite useful for building realistic FPS game where where the gun is pointing matters.
Thanks Plai for every videos you made ! This is really useful and very cool :) !
Glad you like them!
You condense such a long (for the first time) process in such a short, easy to follow video! Thank you!
when the world needed him the most, he came back
Great tutorial! Could the next video possibly be on recoil or screen shake because that would add to the "impact" of the game.
I would like a recoil one too but for screen shake you can use the Kings(Brackeys) screen shake
*GAME FEEL*
Omfg i swear im so happy the ytb algorithm let me found this video, they are so usefull!
Nice video. I loved that you used the Karlsson demo for showcase lmao
your tutorials are AMAZING! Thank you a lot!
Thanks works like a charm! Could the next video be about recoil?
bro is our next brackeys, love your content please keep making more of shooting system specially with bullet trails(kinda like karlson)
Thank you for the tutorials! Keep them coming :)
I missed ur sick tutorials bro
I guess next dani video will be on nft, great video mate :)
PLEASE do a ADS/Scope tutorial it would be the best next step in the series and would be a great thing to learn
You are the only youtuber with these tutorials but bring videos fast
The legend has left us again
i wanna make a cool switching animation, but this script makes it very so theres multiple ways to make it, example: ... well, idk how to make that stuff i gotta learn more :/(oh yea and also, good job viber, very usefull... and cool)
Hey you guys seem to know alot about this crap. Everytime I try to reload my ar the console says "coroutine couldn't be started because the game object "pistol" is inactive" and vice versa. How do I fix this?
These videos are great and simple, very nice
your tutorials are simple af. i have learned so much from one of your videos, and im about to watch all your tutorials. i have a project for 27th of march and i have to make a decent game and the map is my college, and i have 11 days to make it, im learning at the moment. keep up the good work, i think i will make it in time by watching your tutorials
WHY DO YOU NEED GUNS FOR YOUR COLLEGE
WHAT ARE YOU PLANNING HERE?!
@@NotHimKoja nah… he’s doing the right thing… i say use nuclear weapons too
clean and awesome tuts ❤
I ran into a problem where when you switch weapons. You can shoot one bullet from the previous weapon. any fix?
I love these tutorials, but how do I disable rapid fire on the pistol?
BEST Tutorials!!!! But, for the next one could you add crouching?
Anyway I could add a delay before switching weapon, to play switching animation and such before switching?
thank you so much for these videos
Thanks. It works without a hitch.
wating for next part :))
GOOD Video .
Is there a clever way of making weapons "unlockable" with this system? As in you can't equip a weapon until a condition is met, like the player having picked it up for instance
ty :] ... EPIC video
Hey, im a bit dense so i might just be blind to a step, but if i interrupt the reloading by ending playtest during the reload, it just breaks the gun, it can't shoot or reload anymore and i have no clue why or how to prevent it from happening, i just reload a backup to fix it.
wut
HE'S BACK
Your tutorials are so helpful bruh thanks a lot
Could you make one on how to pickup a drop weapons similar to csgo style?
I'd love to see a version that adds Aim Down Sights or Shotgun Support
also explosive ammo or something could be cool
He’s back
I swear your the best UA-camr ♥️♥️
straight to the point thank god
Which theme do you use for visual studio
its very nice and calm
Can you please make an ADS tutorial?
YOUR 100TH COMMENT!!!
i wanted to know what should i do for a survival game WHERE i want pickup and drop guns???
I am waiting for the mele weapon like knife sword or something like that
lets go plai
Hey, love u r videos but can u make advanced weapon video with projectile weapons with weapon switch?
inventory? and pickup system
Please more Videos! Would love to know to add sound to the gun
Hey, can you please make a video on how to add sliding to the rigidbody fps controller? Keep up the great work!!!
Dave/Game Development made one with his and his and plais script interlock
@@NotHimKoja thx bro
When I start the game both weapons are visible, how do I fix that?
can you make full based tutorial about "How to make a multiplayer shooter game" please :)
can u make video on how to add slide and crouch in your fps controler
whenever i load another scene it says, "MissingReferenceException: The object of type 'Transform' has been destroyed but you are still trying to access it" can u please help?
can you make a tutorial on procedural gun animation when jumping or landing?
What the asset in video?
where is tutorial no.3!?!?!??!
Whaaaaat you're alive??????
3:26 both my weapons are on alpha 1 (nvm i fixed it)
I sincerely hope you become the next brakeys. Or even better than him
you are very underrated
Is there a way to use the new Input system for switch
Very useful tutorial, could you please add weapon pickups next? I wonder how to make this script check if weapon is picked up and therefore determine to activate it
can we expect a pick up system for weapons and other items?
Tyy broo now just cool gfx
Ty 🙏
can you make a muzzle flash tutorial
ey bloodclat man yo script not work men it break my camera you bomboclaat
Pls help I have still problem with the coroutine
Please make another tutorial on adding particles to your guns when you shoot them and aiming down sight or even crouching and jumping im enjoying this alot please pick this tutorial back up
I have an idea for the next part of this. Recoil or animations
It'll probably be visual / sound fx
But yea I may consider it after that
Can you please make a enemy tutorial
make a sliding tut for the movement tutorial series plz
Bro can you do video "Weapon Effect Shooting" i will happy if you do it:)❤
Very good video; although it has been 10 seconds and I haven't watched it
lol
we need a vid for UI
will you integrate this into your movement project?
It already is, the first part where hes setting up the weapon and already has a FPS controller -- that controller is the one he built or at least similar enough to use this on it.
Whenever I try to press the reload button, it doesn't reload the ammo, I did the code correctly. What will I do?
Send us a pastebin link with the code or something at least
I know you might not see this but if you could if you are making a next video to make an Aim Option? Would really appreciate it!
Yea I probably will
Hi, I don't know if you still read comments but when I switch weapons then fire it fires the current weapon as well as all the ones selected since last shot fired. Is there a fix for this?
did you ever find a fix i have this problem too
same problem
well, i'm a bit late to this but here's the solution (paste this inside the Weapon switching script):
private void Update()
{
int previousSelectedWeapon = selectedWeapon;
for (int i = 0; i < keys.Length; i++)
{
if (Input.GetKeyDown(keys[i]) && timeSinceLastSwitch >= switchTime)
{
// Unsubscribe the event listeners of the previously selected weapon
if (previousSelectedWeapon >= 0 && previousSelectedWeapon < weapons.Length)
{
PlayerShoot.shootInput -= weapons[previousSelectedWeapon].GetComponent().Shoot;
PlayerShoot.reloadInput -= weapons[previousSelectedWeapon].GetComponent().StartReload;
}
selectedWeapon = i;
// Subscribe the event listeners of the newly selected weapon
if (selectedWeapon >= 0 && selectedWeapon < weapons.Length)
{
PlayerShoot.shootInput += weapons[selectedWeapon].GetComponent().Shoot;
PlayerShoot.reloadInput += weapons[selectedWeapon].GetComponent().StartReload;
}
}
}
if (previousSelectedWeapon != selectedWeapon)
{
Select(selectedWeapon);
}
timeSinceLastSwitch += Time.deltaTime;
}
@@SparrowGamerGR Thanks i had this problem too
Someone know why we shoot the fisrt bulelt with the 2 guns ?
yeah I'm having that problem as well. Have you fixed it yet?
@@fragdummy just change this line "private bool CanShoot() => !gunData.reloading && timeSinceLastShoot > 1f / (gunData.fireRate / 60f) && this.gameObject.activeSelf;"
Does anyone know how I could print how much ammo the mag holds and how much is left? example: 13/18
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using TMPro;
public class AmmoCounter : MonoBehaviour
{
public GameObject WEAPON1;
public GameObject WEAPON2;
[SerializeField]
private GunData gunData;
[SerializeField]
private GunData gunData2;
[SerializeField]
private TextMeshProUGUI ammoCounter;
private void Update()
{
if (WEAPON1.activeInHierarchy == true)
{
ammoCounter.text = gunData.currentAmmo + "/" + gunData.magSize;
}
if (WEAPON2.activeInHierarchy == true)
{
ammoCounter.text = gunData2.currentAmmo + "/" + gunData2.magSize;
}
}
}
Make a canvas and add a TextMeshPro. After that, add the script to it and add the gun datas and gameobject.
Please Make Weapon System #3
Great tutorial, but when I switch weapons it still shoots bullet from previous weapon
has anyone found a fix for this?
@@KoopaTheQuick3 yeah I need a fix as well
I love it
what happened to this series?
finally regular lazy boi!!!!!!!!!!!!!!!
Bruh why is it always that when I add something to my game, you create a tutorial about it the very next day
also grab and throw plz (don't want to be to pushy sry)
IM THE 30 LIKE LETS GOOOOOOOOOOOOOOOO
Another amazing video, you earned a subscription today, I hope you sucseed!
Any tips on how to go about implementing bullet tracers like this ua-cam.com/video/cI3E7_f74MA/v-deo.html as the Raycast is now done from the camera and not the muzzle?
keep the muzzle object and raycast the shot from camera but draw a tracer line from the muzzle to wherever your camera raycast hits? I haven't worked with this but it's a thought that popped into my head. May not be viable.
Hello plai !
I wish that you can do a third person player movement tutorial, that'll be awesome from ya !
Sounds like a good idea
Hha bro were is hand !!!!??????👀👀
Dose the king reply
of course 😏
@@plaidev bro I love your vids your a huge inspiration.
finish this plez
✨ p̶r̶o̶m̶o̶s̶m̶
ammo in scriptable object xD
I need you to please stop making variables/changing their names without telling us.
Your code is literally impossible to follow because you autofill so much and use curly brackets so bizzarely. it's like trying to follow a monkey on speed.