I hope you will enjoy the videos guys! I will have a tutorial on Weapon Switching coming up this sunday. Oh and sorry about the over exposed footage ;) I hope some of you will participate in Ludum Dare this weekend - I sure will and plan to make a video about it as always :D Good luck and remember to have fun!
@GameS-lu2vz7 жыл бұрын
Im looking forward to it
@RitobanRoyChowdhury7 жыл бұрын
Can you do some more advanced tutorials for Unity. I would love to see some prototype versions of mainstream games (e.g. Hearthstone, not No Man's Sky, etc.).
@jamesrandomname10007 жыл бұрын
I can't set up the arenas materials and textures ;(
@jamesrandomname10007 жыл бұрын
the arena doesnt come up when i drag it in
@jamesrandomname10007 жыл бұрын
i also just fall throught the arena
@Mousesenpai5 жыл бұрын
he almost covered all the main aspect of FPS games in just 13 mins without any delay. amazing 10/10. This video is so much detailed .
@BlazertronGames5 жыл бұрын
Well he used a premade FPS script.
@mrpotat6804 жыл бұрын
@@BlazertronGames He used his premade fps pack.
@mathstarz11684 жыл бұрын
He even discussed the nature of life's meaning as well! Did you catch it?
@toast58504 жыл бұрын
Engrish?
@KiloLime4 жыл бұрын
Bruh your gun shoots high... does anyone have a answer to this??? I know i did it correct but its not shooting on the cross hair
@stormillion50024 жыл бұрын
"Void die" is a powerful expression
@baby3ddie2864 жыл бұрын
*void
@betoj.l.28174 жыл бұрын
Poor Void
@Simon-tb6tn4 жыл бұрын
I'm going to void to get back to base
@sonic26flash524 жыл бұрын
void*
@voidnn31834 жыл бұрын
:(
@extremegameplays74044 жыл бұрын
everybody gangsta till the cyllinder gets a gun
@testosteroneoverdose4 жыл бұрын
no *B E A N* capsule
@lah35444 жыл бұрын
@Jakey K *karlson vibe plays in the background*
@talrushkeviz55824 жыл бұрын
no, B E A N would get a gun
@testosteroneoverdose4 жыл бұрын
dun din dan dundundundun dun din dao ding dundundundun
@testosteroneoverdose4 жыл бұрын
Do you mean the AT-48
@djninjitsuchannel78576 жыл бұрын
"so now when we go back to unity we shouldn't see any error" My console: 1037 errors
@DavidB-rx3km5 жыл бұрын
The problems always come from not following the tutorial from start to finish - you will always miss one variable somewhere. :) I was putting this into my own script and missed the damage and range variables, and then spent 5 minutes going back through the video for it. :(
@_CloudyBunny4 жыл бұрын
That's the daily life of developers. : )
@lonttugamer29394 жыл бұрын
@@DavidB-rx3km or following outdated tutorials, but i don't think that's the case.
@meganm43504 жыл бұрын
lolololololololol
@kenan23864 жыл бұрын
oh
@HOTA2007 жыл бұрын
this is the best channel for unity users
@hideyboishit5 жыл бұрын
agrreedddd
@ferdizhivina63625 жыл бұрын
don't forget Jimmy Vegas , he has a good channel too
@humphred49125 жыл бұрын
he is an incredibly good teacher.
@mason38725 жыл бұрын
*CODING YOUR OWN GAMES IS EASIER THAN YOU THINK*
@lilpup14145 жыл бұрын
I would like but its at 420
@TinyDeskEngineer4 жыл бұрын
Ah, a medieval arena, a wooden crate, and someone with a FUTURISTIC LASER BLASTER
@Tezos16443 жыл бұрын
lol
@pizzapie52263 жыл бұрын
lol
@_veselin_50483 жыл бұрын
Realistik 100
@TinyDeskEngineer3 жыл бұрын
@Sourav Parik oh yeah, time travel makes sense.
@cinemacat41083 жыл бұрын
I think we should appreciate that he is teaching us with some cool assets that are for free , it is a good joke tho
@ignskeletons4 жыл бұрын
I feel like I'm getting a full college level education from your KZbin channel but without any of the student debt. Thank you sir for the amazing content you provide for Unity!
@bestofgaming34954 жыл бұрын
Me
@charliedeschambault25993 жыл бұрын
Heyyy plz help
@ahmedmohamed-cd7xf3 жыл бұрын
Anybody having the same problem of" 'Target'Does not contain a definitionfor'TakeDamage' and no accessible extension method'TakeDamage'accepting a first argument of type 'Target' could be found" please heelp🥲
@lr5143 жыл бұрын
I know I’m 1 month late, but it means you either forgot to make the method TakeDamage entirely or you forgot to make it public
@cucksterhingle59303 жыл бұрын
@@ahmedmohamed-cd7xf save all of your .cs files, if you dont save all of them target doesnt become public
@levibotos25344 жыл бұрын
Me: its correct Visual Studio: its correct Unity: you cant enter play mode with compiler errors.
@cosmonut-fr4 жыл бұрын
You need to attach VS code with Unity
@cosmonut-fr4 жыл бұрын
Then it will start calculating all your errors,tnx
I like how he manages to keep the content easy for newbies to understand while moving at a breakneck speed and not wasting one second of the viewers' time. That's talent right there.
@jimmyfigliomeni93854 жыл бұрын
Brackeys team, I just want to say thank you for putting together all of these tutorials. They are laid out and presented well, allowing for even a novice like me to follow! Well done and I look forward to watching more in the future!
@createria24 жыл бұрын
since I saw everyone had +1000 errors here you have boys enjoy: -Gun.cs: using System; using System.Diagnostics; using UnityEngine; public class Gun : MonoBehaviour{ public float damage = 10f; public float range = 100f; public float fireRate = 15f; public float impactForce = 30f; public Camera fpscamera; public ParticleSystem muzzleflash; public GameObject impactEffect; private float nextTimeToFire = 0f; // Update is called once per frame void Update () { if (Input.GetButton("Fire1") && Time.time >= nextTimeToFire) { nextTimeToFire = Time.time + 1f / fireRate; Shoot(); } } void Shoot () { muzzleflash.Play(); 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); } } } ---------------------------diferent script-------------------------------- target.cs: using UnityEngine; public class Target : MonoBehaviour { // Start is called before the first frame update public float health = 50f; public void TakeDamage (float amount) { health -= amount; if (health
@drokos82394 жыл бұрын
hi i tried it and it still doesnt work, it said: the type or namespace name Target could not be found (are you missing a using direcetive or an assembly reference) please help
@createria24 жыл бұрын
@@drokos8239 Just to make sure these are the 2 scripts are you sure you didnt copy the part where I enter target.cs if you didn't could you give me the exact error
@cianj87984 жыл бұрын
in Gun.cs " Target " is showing up as an error, saying it could not be found
@jordangonzalez41934 жыл бұрын
@@cianj8798 you need to do the target.cs code for that code to work
@volcanowater4 жыл бұрын
there is a error called Assets\Target.cs(22,6): error CS1513: } expected
@Pr3DaToR157 жыл бұрын
So quick. .yet very detailed. Learnt a few new things. Thanks.
@magnusm47 жыл бұрын
Going by these alone, just some few things and you have the basic controls for an fps. Now just need levels, models, sound and ai
@yikes19107 жыл бұрын
The quality of these videos are amazing, keep up the good work! 💪
@coolboidoesstuff98285 жыл бұрын
literally. It is default 1080p HD
@Shutupnerd9043 жыл бұрын
@@coolboidoesstuff9828 time to be wooshed away
@gmplus98422 жыл бұрын
@@coolboidoesstuff9828 so your telling me that FHD is normal dude im waching this vid in 480?
@hypercharge26 Жыл бұрын
@@coolboidoesstuff9828 r/whooooooooosh after 4 years get rekt
@FaissalsAnimation4 жыл бұрын
It's sad that this channel is "gone"
@ArthurOliveira-zq1tw4 жыл бұрын
Man.... it actually hurts
@bedo29504 жыл бұрын
People ask me why you are depressed Me: No one will understand how sad i was when brackey left the youtube
@danielhuang66684 жыл бұрын
We dont talk about that here
@astickman24864 жыл бұрын
:(
@charliedeschambault25993 жыл бұрын
Heyy plz help
@Cyreides7 жыл бұрын
I watched this even though it's completely irrelevant to the needs of my own Unity project (I'm making a 3D platformer) because simply put... your tutorials are so interesting and thorough and insanely professional in presentation that I can't help but watch, and I still think I ended up learning somethings that I'm sure will be useful down the road. I'm gonna be digging through the rest of your videos as I can! Keep up the amazing work!
@d-o-n-u-t5 жыл бұрын
Procrastination via NOT procrastination. Stop it, Cyreides... you're scaring the kids...
I know that this is for beginners, so maybe in another tutorial you should talk about how its better to pool objects that would other wise be created a lot so that its more efficient.
@Brackeys7 жыл бұрын
That's a really good idea! Noted :)
@invertexyz7 жыл бұрын
Also, to use RaycastNonAlloc so that you're not generating garbage every shot that the GC has to take care of.
@GoldenTab7 жыл бұрын
Mr Anderson Noice idea! ;)
@cam47227 жыл бұрын
I would LOVE to see you do an object pooling tutorial so a newbie like me can understand it!
@hydraxdomin80096 жыл бұрын
The function "Die" should be inside the class "TakeDamage".
@nuffuru14903 жыл бұрын
I would recommend adding the line "ImpactGO.transform.parent = hit.transform;" after instantiating your impacteffect because if you're working with bulletholes too this way the bulletholes will move with the object they're on instead of just staying there.
@jacobp.6160 Жыл бұрын
needed this to use the effect for different types of effects. Thank you
@SHAHSAMINYASAR4 жыл бұрын
*_Me while watching this:_* Wow,,that's so easy. *_Me after coding:_* error;error;error;error
@monarc83474 жыл бұрын
Yes the pain
@astickman24864 жыл бұрын
@@monarc8347 Hello there
@monarc83474 жыл бұрын
@@astickman2486 General Ken Obi
@pythro_4 жыл бұрын
@@monarc8347 Ahh, nice
@monarc83474 жыл бұрын
@@pythro_ General Pytro
@CookingWithCows7 жыл бұрын
I really love your channel. It helped me a lot in programming in Unity, so thank you for what you do! I would like to see a video/mini series on how to make a simple inventory system with an inventory/bag UI, different item classes that do different things when left/right clicked while held in your hand and so on. Think minecraft/harvest moon. How to make sure your character doesn't try to drink your axe or shoot with your potion. How to "make" different item classes with different properties in an outside source like a json file (a potion doesn't need a fire rate, or does it, is fire rate the same as drinking cooldown, a crossbow doesn't need a property of how much it heals you) and how to import them into the game as an items list. common pitfalls and things where people get stuck when creating an inventory/item system.
@robloxiansexclusive17812 жыл бұрын
woah
@michaelrothkopf40884 жыл бұрын
YOU ARE THE BEST I LOVE YOUR CHANNEL THANK YOU! I would have never gotten into Unity dev without you. You have been so helpful. You turned something so complicated and made it super simple. Instead of making it look easy, you make it easy. THANK YOU.
@suryanshjadhav92263 жыл бұрын
Brackeys: so now when we go back to unity we shouldn't see any error Unity: We don't do that here Even better: Brackeys: so now when we go back to unity we shouldn't see any error Unity: *HIPPITY HOPPITY ERRORS ARE NOW YOUR PROPERTY*
@dragonman78063 жыл бұрын
ikr
@xegrand75483 жыл бұрын
Is it me,or is your comment looking kinda T H I C C ?
@suryanshjadhav92263 жыл бұрын
@@xegrand7548 im a dani subscriber too!
@xegrand75483 жыл бұрын
@@suryanshjadhav9226 lol Karlson is off to become the most anticipated game of 2068
@suryanshjadhav92263 жыл бұрын
@@xegrand7548 so we wait 47 years... I thought 84 So when karlson releases when the entire fanbase i old ill tell my grandkids to buy it lol
@krookked58686 жыл бұрын
you are the special person that is making my dream job possible
@RIP-GG10 күн бұрын
Pullin up 7 years later to say this still works in Unity 2023. Simple, clean, and timeless solution. Brackeys is tha GOAT!
@CreaturesCanada7 күн бұрын
Did you manage to get the flare particle system? It’s not there for me.
@RIP-GG7 күн бұрын
@@CreaturesCanada It's in the standard assets which you have to download then import via the package manager. It's still there.
@corr21434 жыл бұрын
That was an awesome description of the raycast hit, was able to implement the same thing to a character kicking objects, learned the transform.name and the rayccast in one video and many more things, you're awesome Brackeys!
@historvical60623 жыл бұрын
The legend never dies...
@APMM193 жыл бұрын
Uh
@akshat73104 жыл бұрын
whose watching this after Brackeys quit?
@yaboiethan81124 жыл бұрын
OH OH ME!
@ahmadhashmi77914 жыл бұрын
yes me
@ahinssu6174 жыл бұрын
yes :(
@fishy_964 жыл бұрын
Yes me :( 😭
@sillyfella20094 жыл бұрын
Me. :-(
@thesenate65233 жыл бұрын
Brackey: just create a particle that you like My Brain: Error 404
@ionpotato15623 жыл бұрын
i had to look up another tutorial
@philiphutchings24774 жыл бұрын
If anybody is having trouble figuring out why their hit effect particles wont work(probably because you havent imported the effects system and just duplicated the muzzle flash and turned it into a hit effect basically), because you duplicated it, when you shoot it makes a new object right, so when its made its being awakened essentially, and because you duplicated the muzzle flash which had play on awake disabled, it wont display a hit effect. turn that bad boy on and you will have a hit effect when you shoot something. hope this helped anyone that struggled like i did
@crazykidplayz64983 жыл бұрын
I spent 12 days trying to get guns working in my game and MY BOY BRACKEYS HAD A VIDEO ON IT THE WHOLE TIME
@CapitalOBeats5 жыл бұрын
Loving the tutorials brotha, Only been game making for about a month. And your videos seem to be to only ones i watch, and dont end up with a headache and a bunch of errors lol. Keep it up
@PabTSM-OfficialChannel4 жыл бұрын
Brackeys: Now we shouldn’t see any errors. unity: haha errors go BOOM BOOM
@ihumbleyou3 жыл бұрын
Same lol
@ahmedmohamed-cd7xf3 жыл бұрын
Im having this error " 'Target'Does not contain a definitionfor'TakeDamage' and no accessible extension method'TakeDamage'accepting a first argument of type 'Target' could be found" please heelp🥲
@sparkestic12383 жыл бұрын
@@ahmedmohamed-cd7xf i also have the same error
@sparkestic12383 жыл бұрын
@@ahmedmohamed-cd7xf ok... I found one solution... Save your progress and than restart your project... It worked for me
@ahmedmohamed-cd7xf3 жыл бұрын
@@sparkestic1238 wow it actually worked thank you so much❤❤
@kristiyanaleksiev84033 жыл бұрын
4 years later still using it. You are a beast.
@robertoleto23993 жыл бұрын
I have a problem with the target variable, it doesn't exist
@kristiyanaleksiev84033 жыл бұрын
@@robertoleto2399 it worked for me
@not_herobrine37524 жыл бұрын
Imagine being simply able to import the FPS character in later versions of unity
@ArthurOliveira-zq1tw4 жыл бұрын
It would be NICE UNITY
@not_herobrine37524 жыл бұрын
Ok so i spent a week making my own, not the best substitute, but it will do
@teoskrn15184 жыл бұрын
@@ArthurOliveira-zq1tw They don't now to try reducing the ammounts of assetflips made by incompetent people, I think.
@charliedeschambault25993 жыл бұрын
Hey help me
@rohan_nishant3 жыл бұрын
@@not_herobrine3752 Brackeys has a tutorial for an fps character, you could have used that
@lovnishjain92875 жыл бұрын
By combining your tutorials i will make my own game soon. :)
@tssper34884 жыл бұрын
Thats exactly what im doing now, except with my own terrible models and designs :)
@nitrozoronstudio20054 жыл бұрын
everyone is LOL
@boba_t9514 жыл бұрын
@@tssper3488 Dude, you can use Google Poly for awesome models.
@angelconstandachi79054 жыл бұрын
@@tssper3488 exactly da same
@logankrake21994 жыл бұрын
Same
@joblesskid59223 жыл бұрын
i replayed this vid 6 times just to i can help funding , but they're arent any ads, means this tutorial is really earning nothing but it taught me a lot... i love you host
@urielcobo-cuisana23163 жыл бұрын
He- He left us 10 months ago. 😭
@joblesskid59223 жыл бұрын
@@urielcobo-cuisana2316 i agree , we all miss him. he was the best teacher ive seen so far.. do you know someone else like him that makes similar content for "unreal engine" ? cause im really looking for one
@erykschubert4 жыл бұрын
If you use the impact effect, which creates the static mark on the object being hit and you don't want it to be destroyed, instead of using Destroy(impactGO, 2f), you can use ImpactGO.transform.parent = hit.transform to maintain the mark location on objects.
@ahmedmohamed-cd7xf3 жыл бұрын
Anybody having the same problem of" 'Target'Does not contain a definitionfor'TakeDamage' and no accessible extension method'TakeDamage'accepting a first argument of type 'Target' could be found" please heelp🥲
@CAESAR_IS_GOD_mohammadisaloser3 жыл бұрын
how could I leave a bullet hole using that?
@alwayssoftgames66362 жыл бұрын
If anyone wants the raycast to shoot out of a specific point of the gun (like the muzzle) instead of out of the center of the screen, do this: -First, go into the fire script -change the "public Camera fpsCam" variable to a "public Transform muzzle" variable (you can name the Transform whatever you want, I chose "muzzle") -Then in the "Void Shoot" function change the "fpsCam.transform.position" to "muzzle.transform.position" and the "fpsCam.transform.forward" to "muzzle.transform.forward" -Now in the inspector drag and drop the muzzle of the gun into the "Muzzle" component. -If your gun does not have a muzzle, create an empty object that is the child of the weapon, name it "Muzzle", and position it on the tip of your gun. Hope this helps, it worked for me.
@jacobscott8277 Жыл бұрын
Hey, I used your code, its not dectecting the ray when I click. This is my code (I change it slightly) using UnityEngine; public class gun : MonoBehaviour { public float damage = 10f; public float range = 100f; public Transform muzzle; // Update is called once per frame void Update() { if(Input.GetKeyDown(KeyCode.Mouse0)) { Shoot(); } } void Shoot () { RaycastHit hit; if (Physics.Raycast(muzzle.transform.position, muzzle.transform.forward, out hit, range )) { Debug.Log(hit.transform.name); } } }
@jacobscott8277 Жыл бұрын
Nevermind sir I fixed it myself it was a issue with the rotation thank you for the info about the muzzle heres a free compliment... "your cool" - me
@Gneey2Smooth Жыл бұрын
Does this still work for now?
@berku11 ай бұрын
you're@@jacobscott8277
@feeney87152 жыл бұрын
I learned SO much from this one tutorial, - I learned raycasts - I learned more variables - I learned how to acces scripts from scripts (lol) - I learned how to make a crosshair and WAY more, ty for the tutorial!
@doramus2 жыл бұрын
Really Useful Tutorial, We miss you Big Brack :(
@Dacommenta7 жыл бұрын
Coding your own games is easier than you think.... u know.... you should take this online unity course on udemy...
@alexisbodet91957 жыл бұрын
this dude makes me crazy..!!
@kryptoniancuber60637 жыл бұрын
I always get that ad -_-
@brandonbennett95307 жыл бұрын
and as soon as i gave u a thumbs up, KZbin suggested i go add free with a subscription!.... ahhh!
@willia_music7 жыл бұрын
Funny enough I've been taking that Udemy course starting this year. And supplemented with Brackeys it has been a lot of help. Glad I got the course before seeing the adds or else I would have been like fuck that
@felixjanetzki73646 жыл бұрын
This is so killing me
@Matevoz725 жыл бұрын
I wish he actually taught us how to make the muzzle flash cause I cannot figure out how he did it.
@gelis074 жыл бұрын
me too
@rgb_824 жыл бұрын
@@gelis07 Yeah, I want that too. Maybe, he already made one? Can anybody tell me?
@gelis074 жыл бұрын
@@rgb_82 he made a video about unity's particle system
@rgb_824 жыл бұрын
@@gelis07 thanks. edit: in case if someone wants to watch that: kzbin.info/www/bejne/fHakYqqKgq90iJI
@mangaartistshamz88164 жыл бұрын
Watch Ups vid
@pongraczadam8286 жыл бұрын
using UnityEngine; public class gun : MonoBehaviour { public float damage = 10f; public float range = 100f; public Camera fpsCam; // Update is called once per frame void Update () { if (Input,GetButtonDown("Fire")) { Shoot(); } } void Shoot () { RaycastHit hit; if (Physics.Raycast(fpsCam.transform.position, fpsCam.transform.forward, out hit, range)) { Debug.Log(hit.transform.name); } } }
@optic_ozzygaming89934 жыл бұрын
you sir are a god
@Simon-tb6tn4 жыл бұрын
Input.GetButtonDown and "Fire1" but thank you so much!!!
@carlosbaltazar59414 жыл бұрын
Isn't there more
@Simon-tb6tn4 жыл бұрын
@@carlosbaltazar5941 It's later in the video. This is the more boring stuff you don't have to really write to remember. It's intuitive.
@jaanoro10514 жыл бұрын
You're a life saver
@devaliero-3d5976 жыл бұрын
Ну и строчит, как пулемет, и все по делу ! Не то что другие жуют сопли и тянут резину. Лайк! Brackeys, you are an an awesome lecturer!
@hierayku8736 жыл бұрын
СОгласен! All right!
@jakeschannel54616 жыл бұрын
Жаль, что я раньше не додумался искать уроки по Юнити у зарубежных ютюберов)
@ACBros_06 Жыл бұрын
6 years later still best tutorials
@realcolby4 жыл бұрын
I love how easy these tutorials are for beginner and experienced programmers.
@axer10153 жыл бұрын
“And we’ll create a function... let’s call it die.” Me whenever I’m boutta smacc someone SO HARD into the sun.
@nuclearbomb94833 жыл бұрын
Void Die() { rb.AddForce(0,1000 * Time.deltatime, 0); } Like this?
@Gredran3 жыл бұрын
Anyone having issues with the muzzle flash: Follow Brackeys settings, but when I learned the BIG thing stopping me from succeeded, I realized I didn't have to, because it changes AS YOU PLAY. Follow exactly what he does, then parent gun model to camera(as in the start) then the particle system to the gun AND use it as the target as in 9:02. After this, it's not shooting right? Well with the particle system parented in this path(camera-gun-particle system) go to the system and now reset the transform(like you do when you add the ground check empty to to character). NOW try and it should work and any setting you change should be as you play!
@Anonymous-up6jt2 жыл бұрын
Thanks A LOT
@manofqwerty7 жыл бұрын
Is anyone having trouble making the muzzle flash?
@SQUIGLEZ7 жыл бұрын
Michael Murphy this is really late 😂😂 but I am having trouble as well. Did you find a solution to make it work?
@manofqwerty7 жыл бұрын
SQUIGLEZ I just went through it again, make sure to pay meticulous attention to all the settings and check boxes he ticks.
@冠霖-l4c6 жыл бұрын
I use the firerate but my muzzleflash just appear only onetime. why?
@shivamkumar-eq3sl6 жыл бұрын
check if it's inside the if condition which you use to fire
@mlgpandagames91766 жыл бұрын
no is simple
@billythebuilder87243 жыл бұрын
Me: deletes start method, visual studio: 12467147628794 errors. Brackeys: deletes start method, visual studio: 0 errors or warnings. me: ok i dont get it
@sagarwankhede.thisside4 жыл бұрын
This worked for me. Hope it helps someone struggling like me. PS. Great tutorial Brackey!!! Thanks! This code is for those looking for a Gun Controller script. public class MouseMovement : MonoBehaviour { float mouseSensitivity = 100f; float xRotation = 0f; public Transform gunBody; public Transform player; void Start() { Cursor.lockState = CursorLockMode.Locked; } void Update() { Rotate(); } void Rotate() { float mouseX = Input.GetAxis("Mouse X") * mouseSensitivity * Time.deltaTime; float mouseY = Input.GetAxis("Mouse Y") * mouseSensitivity * Time.deltaTime; Vector3 gunRotation = gunBody.transform.rotation.eulerAngles; Vector3 playerRotation = player.transform.rotation.eulerAngles; xRotation -= mouseY; xRotation = Mathf.Clamp(xRotation, -90f, 90f); gunRotation.x = xRotation; gunRotation.z = 0; playerRotation.y += mouseX; gunBody.rotation = Quaternion.Euler(gunRotation); player.rotation = Quaternion.Euler(playerRotation); } }
@duracellbattery36255 жыл бұрын
Thank you for helping me make a game I had no clue on what to do and after watch like 5-6 videos I’m starting to get it just wanted to thank you for everything
@ICTitans7 жыл бұрын
Would you maybe do a segment on weapon recoil?
@FLXKZ7 жыл бұрын
Weapon Recoil isn't really hard. I figured out myself. Here a little demonstration: First, you need a Recoil Vector: Vector3 Recoil; //private or public doesn't Matter And a max recoil amount: public float RecoilAmmount = 0.2f; //private or public doesn't Matter again, but I would make it public for ease of use Now before you cast your Ray we need to get a random Vector to change the direction the ray is firing. For that we can use Random.InsideUnitCircle which should give us a random point on a circle. Vector2 recoil = Random.InsideUniCircle()*RecoilAmount; When you now Fire your ray add the Recoil to the FPSCam.transform.forward so if (Physics.Raycast(FPSCam.transform.position, FPSCam.transform.forward + Recoil, out RayHit)) Hoped this helped you and other People. NOTE: I'm still a beginner. This should work, but I don't know if it is the most efficient way of doing it. I will make changes to this comment if someone has a better way.
@chinacat13377 жыл бұрын
Nice recoil script, I'm a beginner too but this gives a nice spread effect to a gun good work man
@XGamezOnlyX6 жыл бұрын
FYI, that script adds spread, not recoil.
@vaskedagame8806 жыл бұрын
-FLXKZ- Couldn't you put random between (-recoilammount , recoilammount) To get it on left as well? Am I mistaking?
@saltyscrimp5 жыл бұрын
@@FLXKZ Very useful my dude
@LumineMainCharacter2 жыл бұрын
After watching and following the video I threw a salute so hard that I almost cracked my skull, thanks Brackeys. You are a legend.
@subarunatsuki19022 жыл бұрын
A-are you okay?
@sushantdevkota14614 жыл бұрын
This feels sad now
@FaissalsAnimation4 жыл бұрын
Yeah...
@yassineelatlassi63234 жыл бұрын
Aww :(
@ArthurOliveira-zq1tw4 жыл бұрын
It really does
@Sp8dezz4 жыл бұрын
i swear im actually crying
@Sp8dezz4 жыл бұрын
it rlly hurts :(
@boogiehasfun Жыл бұрын
if you want to sprint here is some code you can add: in "void Update" add: if (Input.GetKey(KeyCode.LeftShift)) { speed = runSpeed; } else { speed = 6; } and add a public float called run speed with something similar to: public float runSpeed = 10f; and boom! you now have a simple running system in your game that can easily be changed.
@SunaKhei933 жыл бұрын
You know Brackeys, THIS helped me a shit ton right now. Thank you!
@jorgeanimates44434 жыл бұрын
for those who just want the code using UnityEngine; public class gunscript : MonoBehaviour { 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; // Update is called once per frame void Update() { if (Input.GetButton("Fire1") && Time.time >= nextTimeToFire) { nextTimeToFire = Time.time + 1f / fireRate; shoot(); } } void shoot() { muzzleFlash.Play(); RaycastHit hit; if (Physics.Raycast(fpsCam.transform.position, fpsCam.transform.forward, out hit, range)) { 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); } }
@hshshshehd44 жыл бұрын
thank you man i appreciate it
@kokachi3589 Жыл бұрын
thx
@Eft609 Жыл бұрын
it does not work
@jorgeanimates4443 Жыл бұрын
@@Eft609 idk man, that was the code in the video
@isktcha Жыл бұрын
you are a time saver Thanks man W comment
@JohnnyBoyleGameDev2 жыл бұрын
Muzzle Flash Issue Solution: The solution that I found was turning the fire rate to 10 or below, for some reason when its higher the muzzle flash doesn't show up. (Also make sure to do this in Unity and not in the code as "fireRate" is a public variable). Hope this helps.
@llucgarciacrumols4330 Жыл бұрын
The best video I have found about how to use raycasts, very well explained, with clear information. Thanks for the video.
@camtuber234 жыл бұрын
As as always, *the curly brackets.* :)
@rachelabella50444 жыл бұрын
just a suggestion for the commenters: If you have a recoil animation it helps to use an animation event and make the particles go off of that
@shauryapal56843 жыл бұрын
I miss you, please come back :)
@marynoble-tolla74344 жыл бұрын
imagine actually finishing this in like 14 minutes, took me 4 hours to get everything working right.
@nejczagozen42174 жыл бұрын
it' a day 276....... 276 day with no success
@monkeyrobotsinc.98753 жыл бұрын
Try 4 months dude
@victorrus013 жыл бұрын
DId you get the error of The type or namespace "Target" could not be found. Are you missing a using directive or assembly reference?" I'm stuck with this problem. I feel like Brackeys lied a lot on his tutorials :(
@NoThrottle3 жыл бұрын
@@victorrus01 Did you make target a public method?
@Yeetmaster9823 жыл бұрын
@Grievous i had that problem and that fixed it
@lucafrancis5572 Жыл бұрын
If anyone is having the issue that I lost my mind over with the particles spawning randomly. Go to Auto Random Seed under the particle system and disable it. Then go over to the shape part and change it from a cone to a sphere and make the radius and radius thickness of the sphere something very small (like 0.0001). Hope this helps
@agustinquindimil65942 ай бұрын
Thank you so much Brackeys, you are really the best teacher out there man!
@tobias231h7 жыл бұрын
A video about your Chrome Addons would be awesome!
@DeitelSoft7 жыл бұрын
Good! Thank you for the tutorials, greetings from Mexico!
@NoobGameDev211 ай бұрын
Thank You So Much, I tried a few times and it didnt work but i finally got it working and am very happy with it and building off of it Thany You SOOOO SOOOO SOOOO MUC You do not understand how much this helped THANK YOU
@techytech264 жыл бұрын
For anone having issues with muzle flash and imapact effect i have found this asset which might be useful assetstore.unity.com/packages/vfx/particles/war-fx-5669
@RedShedG4 жыл бұрын
Thx
@benhogan864 жыл бұрын
THANK YOU SO MUCH!!!!!! YOU SAVED MY GAME!!!!!!
@Fatestcates4 жыл бұрын
thx, they are cool assets too
@CountDown-ff5nx4 жыл бұрын
thank you so much man this helps a lot
@davegth18144 жыл бұрын
Thank you so much. im so bad at using UnitysParticleSystem. but it also changed my life in a good way.
@toluyole3 жыл бұрын
Either I was watching this video with *X2* Speed or Brackeys was just going *SPEEDRUN!!!*
@cubecraftgaming96693 жыл бұрын
Well just watch it at 0.5x speed so he isn't going as fast as dream🤣🤣🤣🤣🤣
@benking11582 жыл бұрын
Brackey: "we shouldn't see any errors" Me: "laughs awkwardly while quietly fixing a console page full of errors"
@flashgames12737 жыл бұрын
Pls do also gun animations, like reloading, aiming and so on! Awesome video!
@RitobanRoyChowdhury7 жыл бұрын
You would have to rig and animate the gun 3d models in a program like blender instead of unity. You can look up rigging or animating a gun in blender, and i'm sure you'll get many results.
@salahaldin57607 жыл бұрын
He can actually animate it in unity ,but the weapon shot be separate and he could then animate it in unity ,but also i prefer using other 3D software like Blender or Maya because they have much more features and tools for animation.
@jakemelendez20864 жыл бұрын
A lot of his tutorials work but I can’t get this one to work
@skyblade_studios4 жыл бұрын
How So?
@alexgrantX2284 жыл бұрын
you might try a different version of unity, I use unity 2019.2.3, and it should work for most things he shows
@keith8194 жыл бұрын
By far teachers like yourself are what makes Unity shine
@GameS-lu2vz7 жыл бұрын
Thanks, man! That film was really helpfull!
@tobycook90397 жыл бұрын
m8 this aint a film, its a youtube video XD
@tealyy3 жыл бұрын
if your doing this on newer versions of unity, instead of typing if (Input.GetButtonDown("Fire1")) { Shoot(); } type if (Input.GetMouseButtonDown(0)) { Shoot(); } new versions of unity dont seem to recognise fire1 as lmb 0 is lmb, 1 is rmb, 2 is scroll wheel
@NotARealPersonBR2 жыл бұрын
the newer versions don't come with standart inputs, you have to assign them manually
@skabben882 жыл бұрын
I would recommend using hit.rigidbody.AddForceAtPosition(transform.forward * impactForce, hit.point); for adding force to the hit rigidbody. That takes into account where the normal was hit, which makes the object react more realistic to the impact.
@spooxtheskeleton7 жыл бұрын
It's telling me that _"The type or namespace 'Target' could not be found. Are you missing an assembly reference?"_ edit: I fixed the problem. Just changed the variable class from Target to Enemy
@tylerkipling18644 жыл бұрын
THANK YOUUUUUU
@liam75Beats4 жыл бұрын
Doesn't work for me ): what do you got in the ?
@liam75Beats4 жыл бұрын
@@tylerkipling1864 what do you got in the ?
@leomenz94 жыл бұрын
@@liam75Beats no, what he meant is that you have to change the variable class from Target to the name you gave the script/your enemy and you also have to do this in the
@gorjangogoythd39104 жыл бұрын
GOD BLES U I WAS STUCK FOR 2H
@redtshirtgaming44184 жыл бұрын
Can you make a tutorial on how you made the particle system/lighting for the muzzle flash please? Love your vids! :D
@alpacino68594 жыл бұрын
dude in my unity the arena only has those fire things under slying platforms and thats it can someone help me ?
@redtshirtgaming44184 жыл бұрын
@@alpacino6859 what do you mean?
@alpacino68594 жыл бұрын
@@redtshirtgaming4418 I mean I only have those effects underneath the platforms but not all the arena can you help me ?
@redtshirtgaming44184 жыл бұрын
@@alpacino6859 I was getting the same problem. What I did was kept moving the particle emitter up until the particles were by the gun. Hope this helps! :)
@alpacino68594 жыл бұрын
@@redtshirtgaming4418 thx I am testing it right now
@Phoenix-04554 жыл бұрын
holy brightness
@BeeWithSunglasses3 жыл бұрын
ah yes, the power of unity particle system
@kirayoshikage6473 жыл бұрын
thicccc
@kelpdock89133 жыл бұрын
lmao used this to simulate planting seeds
@billythebuilder87243 жыл бұрын
u wanted to plant seeds in a game, and searched for a tutorial on how to make a gun work in unity........creative
@kelpdock89133 жыл бұрын
@@billythebuilder8724 yeah it was mainly for the raycasting code but it worked pretty well, got rid of the health and killing stuff and instead of instantiating a particle system it instantiates seeds which grow i abandoned this project tho
@artursoares863 жыл бұрын
The muzzle flash tip helped me a lot, thank you!
@ishanchoudhary41794 жыл бұрын
Now I know what whole unity is based on public float
@beany_man15734 жыл бұрын
I Just came from the fps movement tutorial. Following along I made the gun a child of the main camera. but when I look up or down the gun has some weird stretching. How do I fix this??
@starky17684 жыл бұрын
Me 2 and dunno how to fix it
@sami_Sahraoi4 жыл бұрын
me too
@starky17684 жыл бұрын
anybody here know how to fix it
@sami_Sahraoi4 жыл бұрын
@@starky1768 how?
@starky17684 жыл бұрын
@@sami_Sahraoi well i did just create new script and used one script from danis tutorial kzbin.info/www/bejne/jnKmaYhvYsmHkLc&ab_channel=DanisTutorials and than i aded a gon with a script and it worked :)
@giannisspernovasilis42663 жыл бұрын
best tutorial channel ever
@nt-stha9166 Жыл бұрын
Who is watching this after 5 years
@seymenozdes Жыл бұрын
me :(
@tt3bxitbag1184 жыл бұрын
0:30 I Recommend you to use blender when modeling your gun
@tt3bxitbag1184 жыл бұрын
@Thevenot Jacob yeah me too it need 6 gb minimum RAM and my pc is... 2gb RAM 😣😣
@benas7634 жыл бұрын
@@tt3bxitbag118 have yout tried ZBrush its really easy to run but a little complicated
@leomenz94 жыл бұрын
I CANT 3D MODELLLL
@Nacho-ms2pw4 жыл бұрын
@@tt3bxitbag118 i have 264 gb ram what PC you have?? lmao
@1.25nuclear34 жыл бұрын
This guy is..... I really love this guy.He is awesome.
@FaissalsAnimation4 жыл бұрын
He's gone tho...
@Cyb118935 жыл бұрын
If your mazle flash does not work then you need to rewrite the script. void Update () { if (Input.GetButtonDown ("Fire1")) { mazzleFlash.Play (); Shoot (); } }
@cun1nger2995 жыл бұрын
M A Z Z L E F L A S H
@marcdani90014 жыл бұрын
how about that default particle system in unity around 9:15 where can I find that???
@davicro88175 жыл бұрын
Hey, so I'm kind of a noob and I followed the tutorial and it works fantastic! Except that depending on which face of an object I shoot, sometimes the particles are waaay off, someone know how to fix this? Thanks.
@davicro88174 жыл бұрын
Okay, so I figured it out, the problem was that the particle in the prefab wasn't at position 0, so the particle didn't rotate properly
@harrangkhalsa74084 жыл бұрын
@@davicro8817 hey could you help me out? I can't find the flare prefab under the standard assets. Did you use that or did you use something else
@davicro88174 жыл бұрын
@@harrangkhalsa7408 That's strange, are you sure you looked in the right folder? To check if it's in assets just type in the search bar and see if it shows up. If it doesn't, it may be under packages instead of assets
@harrangkhalsa74084 жыл бұрын
@@davicro8817 I figured it out, somehow it got deleted, so deleting and importing the standard assets worked. I have another question though if you could help, I turned looping off, but when the effect should stop, smoke and sparks still come out. Did that happen to you/did you figure out how to stop that? Thanks for the help
@davicro88174 жыл бұрын
@@harrangkhalsa7408 You probably only set looping off for the parent object, which doesn't disable it for the other objects. You need to go through each child object (the smoke, the sparks) and turn looping off for those
@Underarmour813 жыл бұрын
Worked amazing for what I needed! Still one of the best, sad their no longer doing anymore content.
@RealWyattH2 жыл бұрын
Heres the "Gun" code: using UnityEngine; public class gun : MonoBehaviour { public float Damage = 10f; public float Range = 100f; public Camera fpsCam; public ParticleSystem muzzleFlash; // Update is called once per frame void Update() { if (Input.GetButtonDown("Fire1")) { Shoot(); } } void Shoot () { RaycastHit hit; if (Physics.Raycast(fpsCam.transform.position, fpsCam.transform.forward, out hit, Range)) { Debug.Log(hit.transform.name); ///! = is not enemy enemy = hit.transform.GetComponent(); if (enemy != null) { enemy.TakeDamage(Damage); } } } }
@vmqs2 жыл бұрын
thank you so much
@ansnazir40852 жыл бұрын
thank you bro
@uviolin5932 жыл бұрын
mine wasnt working imma try this one
@rishikandeepan5973 Жыл бұрын
@@uviolin593 the goat
@SAPETConstantiam4 жыл бұрын
The code target.TakeDamege (damage); doesnt work. And I dont know why because I was doing everything like you were doing.
@kelmish42004 жыл бұрын
Is Damage is spelled wrong its "TakeDamage" not "TakeDamege" you have an e where an a is needed
@SAPETConstantiam4 жыл бұрын
@@kelmish4200 yes I know I spelled that wrong but in the code I have TakeDamage and it doesnt work
@tharindu2074 жыл бұрын
@@SAPETConstantiam is your TakeDamage() public?
@SAPETConstantiam4 жыл бұрын
@@tharindu207 no it turnedout that i needed more code because of my camera in unity but now its working
@TitusSupremus4 жыл бұрын
@@SAPETConstantiam what code was this
@NewHopeGames4 жыл бұрын
I been searching around for fps shooting tutorials. This video is really helpful.
@Konoshi1864 жыл бұрын
The Automatic shooting was working but the particles still only showed when I clicked the mouse button not when I hold it so please help
@randomwanderer3114 жыл бұрын
make the particle system loop
@Konoshi1864 жыл бұрын
Oh I already fixed it
@Konoshi1864 жыл бұрын
Thanks for helping though
@axcpt90284 жыл бұрын
@@Konoshi186 what was your solution?
@izzaacalley4 жыл бұрын
guys i chose the color "bus yellow" for my cross hair (which is scientifically proven as the most noticeable color, which is why it's on school buses for high visibility) and it is AMAZING it feels much better to aim with this than with the black. It is much easier to keep your eyes on the dot if you have a hard time doing that like me. i decreased the opacity though because it's a little TOO eye catching. BTW the exact RGB color model for this is, Red 255, Green 215, Blue 0, and opacity is up to you.