The "Pay what you want" thing is such a great idea, I'm gonna steal it! EDIT: I just got back into Unity, and remembered to check out your channel since it's where I first started learning 5 years ago. I'm actually blown away by the quality and enjoyment of these tutorials. Great job my friend!
@luciorojas42787 жыл бұрын
I have seen videos with 30 mins duration talking a lot, I love how you speak fast and directly to the point ("This does this because unity reacts like this and this-") I've learned a lot, thank you and keep going :D new suscriber here!
@vaskedagame8806 жыл бұрын
shooting video = 350k views weapon switch = 90k reloading = only 50k
@krustykrew76855 жыл бұрын
People I guess don’t like Limited ammo
@StaticM2235 жыл бұрын
@@krustykrew7685 No people give up
@servety84724 жыл бұрын
@@StaticM223 why?
@user-th8nx4cp7w4 жыл бұрын
it looks like people start giving up
@nikkiofthevalley4 жыл бұрын
@@servety8472 HAVE YOU NEVER EXPERIENCED CODING BEFORE!?
@MaeveFirstborn7 жыл бұрын
The first 3 seconds are easily the best beginning to one of these yet.
@whomp38172 жыл бұрын
For those who are too lazy like me, here's the updated code! Gun.cs: using System; using System.Diagnostics; using UnityEngine; using System.Collections; public class Gun : MonoBehaviour{ public float damage = 10f; public float range = 100f; public float fireRate = 15f; public float impactForce = 30f; public int maxAmmo = 10; private int currentAmmo; public float reloadTime = 1f; private bool isReloading = false; public Camera fpscamera; public ParticleSystem muzzleflash; public GameObject impactEffect; public Animator animator; private float nextTimeToFire = 0f; void Start () { currentAmmo = maxAmmo; } void OnEnable () { isReloading = false; animator.SetBool("Reloading", false); } // Update is called once per frame void Update () { if (isReloading) { return; } if (currentAmmo = nextTimeToFire) { nextTimeToFire = Time.time + 1f / fireRate; Shoot(); } } IEnumerator Reload () { isReloading = true; animator.SetBool("Reloading", true); yield return new WaitForSeconds(reloadTime - .25f); animator.SetBool("Reloading", false); yield return new WaitForSeconds(1f); currentAmmo = maxAmmo; isReloading = false; } void Shoot () { muzzleflash.Play(); currentAmmo--; RaycastHit hit; if (Physics.Raycast(fpscamera.transform.position, fpscamera.transform.forward, out hit, range)) { UnityEngine.Debug.Log(hit.transform.name); Target target = hit.transform.GetComponent(); if (target != null) { target.TakeDamage(damage); } if (hit.rigidbody != null) { hit.rigidbody.AddForce(-hit.normal * impactForce); } GameObject impactGO = Instantiate(impactEffect, hit.point, Quaternion.LookRotation(hit.normal)); Destroy(impactGO, 2f); } } } Hope this helps!
@n3onf0x Жыл бұрын
If only there was a reload key tho..
@thecubeku Жыл бұрын
@@n3onf0x i tried animation of relaod but the( animator,setBool(" relaoding") =true;) is not working i have no idea why is that
@prayashshrestha72976 ай бұрын
using System.Collections; using System.Collections.Generic; using UnityEngine; public class GunStuff : MonoBehaviour { public int Ammo = 30; public int maxAmmo; public int currentAmmo; public float reloadTime = 1f; public bool isReloading = false; public Animator animator; public float damage = 10f; public float range = 100f; public float fireRate = 15f; public Camera fpsCam; public ParticleSystem muzzleFlash; private object hit; public GameObject impactEffect; public float impactForce = 30f; private float nextTimeToFire = 0f; void Start() { maxAmmo = Ammo; currentAmmo = maxAmmo; } void OnEnable() { isReloading = false; animator.SetBool("Reloading", false); } void Update() { if (isReloading) { return; } if (currentAmmo = nextTimeToFire) { nextTimeToFire = Time.time + 1f / fireRate; shoot(); } } void shoot() { currentAmmo--; muzzleFlash.Play(); RaycastHit hit; if (Physics.Raycast(fpsCam.transform.position, fpsCam.transform.forward, out hit, range)) { Target target = hit.transform.GetComponent(); if (target != null) { target.TakeDamage(damage); } if (hit.rigidbody != null) { hit.rigidbody.AddForce(-hit.normal * impactForce); } } GameObject impactGO = Instantiate(impactEffect, hit.point, Quaternion.LookRotation(hit.normal)); Destroy(impactGO, 2f); } IEnumerator Reload() { isReloading = true; animator.SetBool("Reloading", true); yield return new WaitForSeconds(reloadTime - .25f); currentAmmo = maxAmmo; isReloading = false; } }
@sonsofdarmy43254 жыл бұрын
i added reload to the code if (Input.GetKeyDown(KeyCode.R) && currentAmmo < maxAmmo) { StartCoroutine(reload()); }
@donaldduck58184 жыл бұрын
“Input button R is not set up.”
@weebz63393 жыл бұрын
oh and you can use "or" instead "and"
@altairattano92603 жыл бұрын
@@weebz6339 If you use "or" instead of "and" the function will trigger itself and will reload everytime you shoot
@totallyrandompersob16643 жыл бұрын
I didn't put reloading. I modified so you collect ammo around the map.
@martinSubeldia3 жыл бұрын
so he won't let you shoot when he doesn't have bullets if (Input.GetButton("Fire1") && Time.time >= nextTimeToFire && currentAmmo > 0) { nextTimeToFire = Time.time + 1f / velocidadDisparo; Shoot(); }
@SavanaStudios7 жыл бұрын
Llllllooooooooooooooooove these kind of videos!!!!!!! I struggled with the whole Gun part and your making it soooo easy! Thank you!
@Brackeys7 жыл бұрын
Glad you like them! :)
@gamerguy89707 жыл бұрын
Brackeys could I make a game and put it on the psp or ps vita please tell me thanks
@zyx84637 жыл бұрын
yes you can! I know how!
@zokaper8015 жыл бұрын
@@zyx8463 how then? ooof 2 yrs ago XD
@rgb_824 жыл бұрын
@@zokaper801 yes, how? oof 10 months ago XD
@Owen3H7 жыл бұрын
Haha loved the intro :D Btw these short videos are really helpful!
@callumwood-brignall78367 жыл бұрын
these past few videos have helped me loads with my college game I am working on
@rjthepanda26446 жыл бұрын
ME TOO! this is great!
@asherblair29396 жыл бұрын
in case anyone was wonder, all you have to do to set r as manual reload key is type || Input.GetKeyDown("r") inside of if (currentAmmo
@BunnyHopSquadUnite7 жыл бұрын
Would love to see a video on creating recoil :D. Not so much the animation, but something in the code that makes it move your crosshair after a shot forcing the user to replace it back.
@talha95857 жыл бұрын
Why not an episode for all GUI stuff? Weapon switch, current ammo..
@ZoZo-vm5sh4 жыл бұрын
there is an weapon switch one.
@jasperkoenis39144 жыл бұрын
ZoZo no to show it on gui he means
@ZoZo-vm5sh4 жыл бұрын
Jasper Koenis my mistake :D
@Sohzy4 жыл бұрын
@@jasperkoenis3914 it isnt that hard tbh... just have a script that outputs your ammo to text
@nikkiofthevalley4 жыл бұрын
@@Sohzy Yea but maybe he's a beginner LIKE ALL OF US.. Although, it's not hard to program but if the errors were more clear on what they even mean maybe it would be easier to code :P
@Jermz0r7 жыл бұрын
Awesome video! I would love to see a tutorial where you have limited ammo and can collect some sort of ammo pack. Keep up the good work! :D
@irregular14304 жыл бұрын
In case anyone wants a prompted reload (via keypress or such) its really easy just add: || (Input.GetKeyDown(KeyCode.R) && (currentAmmo != maxAmmo)) after if(currentAmmo
@jpalbus2442 жыл бұрын
Thank you worked fine but for the line should than read if(currentAmmo
@davidenale177 жыл бұрын
Nice! Also an animation episode would be appreciated :D (character ik). I mean, when you animate a tps how do you sync your realoading animations of the gun, with the arms?
@dami43357 жыл бұрын
Davide Nale sta zitto e impara da solo :P joking lul
@davidenale177 жыл бұрын
zDami lo so fare é che mi é venuto male quindi probabilmente ho sbagliato qualcosa xD
@HalalProgrammer3 жыл бұрын
Brackeys you helped me finish my game! Thank you for posting a reload tutorial. You are so awesome!
@theunityguy_yt3 жыл бұрын
god bless the existence of Brackeys - another insane tutorial
@AD-xt7tg7 жыл бұрын
Why don't these videos have more views THEY ARE AMAZING in every way, I love these videos so much but i'm concerned about Brackey's financial state from all the youtube ad revenue stuff thats been going on. Best of luck thanks for the vid
@GregTash7 жыл бұрын
Aniket Dembi yes I think he deserves more aswell, brackeys won't be affected by the ad revenue thing btw because he features no inappropriate content or course language in his videos
@Brackeys7 жыл бұрын
Thanks for the concern! I'm not too affected by the KZbin changes but my income is definitely not through the roof :) If you want to help me eat you can always support on Patreon! ;)
@GregTash7 жыл бұрын
Brackeys Ye I would definitely donate if I had a credit card, unfortunately I don't so I can't, but I will donate one day when I do :)
@haykav7 жыл бұрын
Same with me
@AD-xt7tg7 жыл бұрын
Defo will give to paetron brackeys has taught me so much in unity from noob to pro KZbin vids worth 1000 dollar courses, when i actually start earning defo will contribute only 16 rn tho : / go brackeys! got me so far
@spacemanJM3 жыл бұрын
I can only wish to be as good at coding as Brackeys, just started coding 2 weeks ago and these videos have been an absolute life saver for me!
@Steven_Something207 жыл бұрын
Excited for the behind the scenes video coming soon!
@Gary1q24 жыл бұрын
Brackeys i love you, u make the most concise, informative and helpful videos for unity. GOOD STUFF
@profesionalshark22533 жыл бұрын
Brackeys deserves the world record for fastest typer
@MrKytman7 жыл бұрын
I wouldn't know what to do without these videos, love you soo much!
@JinYuenLing7 жыл бұрын
So glad I found your channel from Sebastian Lague videos, keep up the good work!
@tr0ph1c7 жыл бұрын
Thank u sooooo much, all your videos are great ; this series IS THE BEST ONE TILL NOW
@macomix90647 жыл бұрын
I have to say that the new Thumbnail design is awesome. :D
@erdembatmaz58065 жыл бұрын
Your tutorials have helped out a ton with a recent project im working on. Thank you so much, subscribed.
@DougyFreshGames6 жыл бұрын
I could not wrap my mind around the gun setup but you have made it quite simple enough for us buffoons starting out lol. Thank you for these tutorials, they are so helpful.
@tankaddict91476 жыл бұрын
Used this method to fire in my tank game, easy to follow and explained perfectly, thanks dude!
@AZASeraph2 жыл бұрын
Brackeys: if we go into unity now we shouldn't have any errors Unity: hippity hoppity errors are now your property
@araskuzucu34566 жыл бұрын
I really like to watch your videos and its really help to my school and personal projects. Nice work!
@marshaliftee90097 жыл бұрын
+Brackeys, I mean Mr. Absjorn Thirslund, mentor won't you continue this series? Desperately waiting for the next part to come, Please add something that we can use to interact with getting on a vehicle. It will be very awesome, I think as you didn't upload any of a car game, this will be a new thing to try and also I am 90% sure your fans out there will love it. And THANKS FOR EVERYTHING ❤
@marshaliftee90097 жыл бұрын
Support this comment and help this reach Mr. Absjorn(Brackeys), so this series stays continued :D
@gamehub42407 жыл бұрын
Yeah man. I think everyone wants this series to be continued and as brackeys posts quality stuffs his fans don't actually want to follow others and so, We WANT MORE!!!
@ifteekharulislam38767 жыл бұрын
#WeWantMore +Brackeys, Please continue the serires
@ellieblaber42436 жыл бұрын
hmm, i guess just simply disabling your player controller and then enabling a vehicle controller when pressing a key looking at the vehicle would work as long as they both have different cameras, although you'd need to create a system for then reenabling the player on the vehicles location
@Gunslinger9627 жыл бұрын
make a video about adding AI opponents
@alejandrozamora34687 жыл бұрын
ishtdeep malhi been looking for that myself
@amrinjaffni42686 жыл бұрын
Im doing my own project after watching you Multiplayer FPS tut, and stuck on reloading stuffs...searched the youtube "reloading ammo unity" and brackeys on the first list basically im saying: luv you brackeys!!!
@jwchunn6 жыл бұрын
So good. So helpful. So fast (which I like). Please keep them coming brother.
@owacs_ender7 жыл бұрын
I have a conservation-focused ammo system that I hope is a bit more realistic and intuitive in my game. It uses an array of images, a for loop, and an ammunition counter mounted on the gun. In short terms, it forces the player to think about when they reload and fire, because the system throws away entire magazines and replaces it with new ones whenever the R key is pressed. This means that if you pressed "R" and you had only shot one bullet, you'd be wasting (maxAmmo - 1) bullets. It challenges the player's instincts to keep their current ammo full no matter what. However, you can also use the provided abilities to tele-shove someone into a wall, ceiling, floor, or other person. (I don't care that it isn't a real word, it is now.)
@boeghh63757 жыл бұрын
I loved the video! Your videos has really improved! :D Love from Denmark ;D
@vision92637 жыл бұрын
Rasmus Boegh do you know that hes also from Denmark (I'm also from Denmark)
@boeghh63757 жыл бұрын
Vision Yea i now 😁
@vision92637 жыл бұрын
Rasmus Boegh okay
@boeghh63757 жыл бұрын
know*
@Brackeys7 жыл бұрын
Thanks! That's mostly because Sofia has started editing the videos (y) ;)
@cutepetsforeveryone62217 жыл бұрын
Damn , good video , i was really needing this , thought ammo picking would be phenomenal , keep it up , man!
@yungmoneyincorporated6016 жыл бұрын
I would love for you to have a tutorial on adding animations like recoil and firing and reloading. That would be great! Thanks!
@piyushsharmaofficial21365 жыл бұрын
Thanks. You help me so much in learning unity from beginning. Thankyou
@AlexVoxel7 жыл бұрын
Amazing tutorial! ps: Can you please consider doing an episode on gun recoil?
@doggo46167 жыл бұрын
sounds cool :D
@KuzkayDev7 жыл бұрын
Alex Voxel Hm, you could possibly rotate characters head/camera by 1 or 2° up or down and to the side, Simple recoil
@zokaper8015 жыл бұрын
and if u want a phyisical recoil then just add a rb force
@GrayGhost281007 жыл бұрын
Love the videos! Keep up the great job!
@atmyz78604 жыл бұрын
for anyone who wants it, this script makes your ammo show up in the screen, here it is just change the nametags to whatever yours is: using UnityEngine.UI; public Text ammo; public int currentAmmo; public int maxAmmo = 32; void Start() { ammo.text = maxAmmo.ToString(); } void Update() { ammo.text = currentAmmo.ToString(); if(currentAmmo < 11) { ammo.color = Color.red ammo.text = currentAmmo.ToString() + " RELOAD"; } if(currentAmmo > 10) { ammo.color = Color.white ammo.text = currentAmmo.ToString() + ""; } } of course this just an example, make sure you assign the text in the inspector, this should work if not reply so I can help you
@Username-yb7pe7 жыл бұрын
you are amazing, you are the teacher for unity for me. i can now program semi complicated programs. you are amazing.
@johnathanheath64805 жыл бұрын
I just downloaded the Sci-Fi weapon asset pack from your website for My Capstone final project I'm currently a student at Full Sail University for game design. I got the free one for right now, I really like what I see when I get paid next month I see myself buying full package
@digitalkiwi39757 жыл бұрын
Great tutorial as always man! Would love it if you could do an episode on how to create an aim down the sights mehcanic, Cheers!
@lifehackerandcheater18032 жыл бұрын
This is 5 years old an the best i found
@GregTash7 жыл бұрын
Thank you so much for making these tutorials brackeys they have improved me a lot! I have a suggestion could you do a tutorial on the animator because I imagine some people including myself struggle with using the animator.
@trhgaming81677 жыл бұрын
U are my hero Brackeys, keep going with the videos!!! :D
@Tristannn-4 жыл бұрын
BRO THANKS SOO MUCH I WAS STUCK AT THE PART WHERE IT KEEPS REPEATING THE RELOAD!!YOU DONT UNDERSTAND HOW HAPPY I AM RIGHT NOW😭😭😭
@jackyboy30257 жыл бұрын
A recoil tutorial would be cool, i cant seem to find any up to date tutorials on it..
@hasanjaber98116 жыл бұрын
Brackeys you are the best keep going for millons of subscribers.
@magnusm47 жыл бұрын
Great tutorial for basics and their glitches. Very helpful and helps small groups of individual developers make a game. I added a new function to your shooting script to choose meelee combat in a different way than other fps games. Hit q and you can either left click to attack or right click to defend and you can't shoot while in meelee of course. I want to add a Raycast to hit but i'm stuck on either doing that or try and find a way to swing a hitbox and work more like Chivalry and Reinhardt's hammer but there isn't any tutorial on anything like that or something that could help make it
@yungmoneyincorporated6016 жыл бұрын
Thank you so much man love your tutorials
@iqball4494 жыл бұрын
Thanks!!Brackey tutorial reloading
@chummyigbo88447 жыл бұрын
Brackeysssssssssssssssssssssssssssssssssssssssssssssssssssss. You guys are amazing . Thanks
@spacex99997 жыл бұрын
Great video! (I totally watched it all)
@nathanrowe79617 жыл бұрын
Clorox Bleach lol
@oleksandr-petrovych7 жыл бұрын
realy ?
@nathanrowe79617 жыл бұрын
Clorox Bleach same I totally watched it
@GtaonlineMe7 жыл бұрын
Awesome as always, thanks!
@cosmingugoasa59497 жыл бұрын
Your videos are so helpful and the quality is very high, keep it up, you are doing a very nice work ! I would like a video on frame rate optimizion :)
@mchristensen56837 жыл бұрын
Yo your hair is dope
@brejnastore3 жыл бұрын
his animation in one line of code without doing any animations target.transform.rotation *= Quaternion.Euler(0, 0, -60f * 10 * Time.deltaTime); target is gun holder :)
@matthew22197 жыл бұрын
thanks brackeys!!
@wehh17 жыл бұрын
Another great tutorial by the one and only. Maybe an animation tutorial would be great in the future. cheers
@Wolcik30007 жыл бұрын
amazing stuff
@levizoibesbr45933 жыл бұрын
hey, im creating my fps game and you are helping me a lot, thanks for this serie, you are the best i dont find no one video BR teaching how you do, thanks for help
@christiangennari65756 жыл бұрын
Love your vids! They are so easy to understand, I've got a request though. A video that show you how to create ammo UI pls :)
@maddoxst70097 жыл бұрын
hey guys i am actually starting a fps creating with char animations :) and brackeys you are great
@RandomDude000016 ай бұрын
Idk why or what happened but because of this video I Learned animating in just a minute
@leewriter46562 жыл бұрын
So this is just for reloading. This has nothing to do with picking up ammo and adding it to your inventory, right? Or am I doing something wrong? Do you expand on this in another video? Love the work you do!
@ByggJacobPL6 жыл бұрын
Hey Brackeys, please make tutorial on how to add animations to weapons while doing certain actions like shooting, reloading, etc. That would be very appreciated. Greetings from Poland!
@christianbarstad12397 жыл бұрын
could you make a video where you make a ammo counter?
@CnBrosOfficial4 жыл бұрын
it's easy you can just make a label and set the text to currentammo! (sry for being late)
@TheBathToaster4 жыл бұрын
@@CnBrosOfficial i... i think he's asking how to make the label and set the text to currentammo...
@shaunchadwick86284 жыл бұрын
Thank you helped me so much
@kryptoniancuber60637 жыл бұрын
You should make a video explaining what coroutines are and how they work.
@thebatmanhimself6 жыл бұрын
some of these weapon models reaaally look like the ones from DOOM
@oliatienza7 жыл бұрын
10 unity tips!
@eimiko_lover4 жыл бұрын
thanks bro
@meltpack88767 жыл бұрын
Instead of setting a book to play the animation, just disconnect the reload animation and in code type anim.play("reload") instead of setbool
@Bat_pann4 жыл бұрын
Your Hair Is Awesome!
@l3poti7312 жыл бұрын
If i change the weapons when the reload is work and a back to the Weapon that was reloading, it doesn't fire. I think the script stops working, but it could be something else. Can anybody help me?
@Arilith7 жыл бұрын
Could you also do a Networking or Animation video next? I'm fairly new to unity and I have follow your make a multiplayer FPS tut, but these new videos are way more useful and I learn a lot more from them. So I would appriciate it if you would redo some more of your old videos :) EDIT: By the way thank you for these great and informative video's. I've learned very much from these vids. Keep up your good work!
@shubhamsherlekar45917 жыл бұрын
great video
@cfffba7 жыл бұрын
I love the VS color scheme you're using. Where can I get it?
@MarioOrtiz0087 жыл бұрын
+Brackeys hey are you gonna keep doing c# videos? I loved your beginner tutorials! Cheers :)
@AustinCapitalofGaming7 жыл бұрын
cool vid man can you make a vid adding hands to hold the guns
@vladsamsonov97527 жыл бұрын
Thank you a lot for your tutorials!! :) From Russian with love)
@navjothb6 жыл бұрын
Keep making cool videos like this :)
@oogaballooga96286 жыл бұрын
Can you go back to this subject and make a gun course on recoil, gun bloom, attachments, etc.
@YANDE097 жыл бұрын
thanks but, how to make ammo and max ammo ui?
@crainyer73295 жыл бұрын
just give out the variable on a canva, you can find a script easely on yt
@RuiNunesDev5 жыл бұрын
@@crainyer7329 I'd also use events to feed the values to the UI
@dami43357 жыл бұрын
Are you serious? Only one ad on the video? Man, add more, you need to get paid :)
@sangeethahc12914 жыл бұрын
Can u make a video were we can pickup guns in unity??awesome video!!!
@tranquilmagister84817 жыл бұрын
how long did it take for you to become this good in programming?
@hatersqn28177 жыл бұрын
Could you make a tutorial of how to make a realistic reloading animation? and your videos are soooooo cool!!
@hunterx22104 жыл бұрын
I do everything on the Animation itself. Things get crazier and complicate when it comes to the amount of save bullets. Say like the gun mag hold 10 bullets. The saving bullet is 300. I have to set up some stage to take exchange bullet if the saving is only have like 9, 8, 7 round left.
@jpeters27827 жыл бұрын
Dude, I love your videos. Can you do something with google vr (or with vr in general, but I don't think many people have a vr headset at home). I think that would be really awesome.
@tonycaterev41007 жыл бұрын
Great tutorial, thanks! Is there any way to display the ammo amount variable on the display with the UI Text? And a float, which allows to place a sound, when the gun is using? :)
@goatrix7 жыл бұрын
maybe make an episode about adding sounds to the guns?
@antsscientist430 Жыл бұрын
Noob programmer here, how can you make it manually reload when you press R? TIA
@Nemko775 ай бұрын
if (Input.GetKeyDown(KeyCode.R)) {the same stuff} Hope after 1 year it's still helpful :D
@JustKatoh7 жыл бұрын
Guessing UI is the next step? :D What about enemies taking damage? What about the player actually taking damage? or, or... just add a spice of multiplayer? :D
@wkhohwwhulvq39314 жыл бұрын
Could you potentially make a item pick up system?
@abelredonet57706 жыл бұрын
Your rock buddy, thanks for the vid... and.... funny about your hair, it's cool.