Weapon Switching - Unity Tutorial

  Рет қаралды 434,723

Brackeys

Brackeys

Күн бұрын

Пікірлер: 594
@talha9585
@talha9585 7 жыл бұрын
These small but useful tutorials are best to watch.
@talha9585
@talha9585 7 жыл бұрын
also, i would like to see switch animation
@coolboidoesstuff9828
@coolboidoesstuff9828 5 жыл бұрын
@@talha9585 It is really not so hard, you can search up how to do it Edit: Never mind, it's harder than I thought
@dmudda90
@dmudda90 5 жыл бұрын
@@coolboidoesstuff9828 no making games is much easier than you think! .. :D
@coolboidoesstuff9828
@coolboidoesstuff9828 5 жыл бұрын
@@dmudda90 No I was talking about him asking for switching animation
@norriswu213
@norriswu213 5 жыл бұрын
@@dmudda90 "You should take this course on Udemy"
@zevac
@zevac 7 жыл бұрын
you're helping me create a universe, brackeys. i love you
@redbepis4600
@redbepis4600 5 жыл бұрын
Did you finish? Can I buy it?
@zeroiq4737
@zeroiq4737 4 жыл бұрын
Red Bepis no lmao
@dexister6959
@dexister6959 7 жыл бұрын
Your newest tutorials are so professional I can't imagine how long it takes to make a 2 minute video for you...
@chantendo2941
@chantendo2941 7 жыл бұрын
your tutorials are super helpful!
@Brackeys
@Brackeys 7 жыл бұрын
Thanks, glad you like it! :)
@neotomatoe7257
@neotomatoe7257 4 жыл бұрын
Yeah ;)
@Jamesthe1
@Jamesthe1 7 жыл бұрын
You could also use modulo (aka the % operator) for the upward weapon switch. It would look like this: selectedWeapon++; selectedWeapon %= transform.childCount; If you don't know what modulo is, it basically gets the remainder from the division statement. You don't have to write a bunch of if statements that way. This saves a few lines and is actually quite efficient.
@light6602
@light6602 7 жыл бұрын
Definitely should continue these smaller videos Brackeys!! Love them! I saw someone request an ammo system and I think that would be awesome! Along with a ui of course.
@SuperRalle123
@SuperRalle123 7 жыл бұрын
As always, these small tutorials are really great! I would love to see one about animations :)
@Cyreides
@Cyreides 7 жыл бұрын
I was going to need something similar like this for switching characters in my game, and this is perfect!
@bisharakhuri2504
@bisharakhuri2504 5 жыл бұрын
Tutorial unclear.. Accidentally created CS:GO
@BredMan_
@BredMan_ 4 жыл бұрын
lol
@sillyfella2009
@sillyfella2009 4 жыл бұрын
I hate it when that happens
@KlutzOfAMan
@KlutzOfAMan 4 жыл бұрын
Task Failed Successfully
@ShyGus
@ShyGus 4 жыл бұрын
That's litterally how good these tutorials are😂😂
@Mikelica69
@Mikelica69 4 жыл бұрын
@@KlutzOfAMan XD
@deraidos45
@deraidos45 7 жыл бұрын
Very helpful as always. Been watching you since the first Survival Game tutorial
@theodorescontras5569
@theodorescontras5569 7 жыл бұрын
Great tutorial, got weapon switching working in my game before even having my coffee.
@obsidian295
@obsidian295 7 жыл бұрын
Been following Brackeys since survival game, awesome channel !
@OilRacki
@OilRacki 7 жыл бұрын
Funny enough, I think I did 80% of this video on my own before seeing this. I think it just makes a lot of sense to do the way described here. It is good confirmation that I'd done things in a good way. There was one thing I did differently though.. I didn't have a "weapon holder" object, and just simply reference children below it, but I think that's just because of my game design. I have more weapons as children than the player can use, so I have something else to manage the weapons they're carrying and have armed. All in all, though, this is a great tutorial, and the method described here about the weapon holder is actually a really good idea. Thumbs up!
@TheReal-Infinite
@TheReal-Infinite 7 жыл бұрын
i'd love to see a continuation of the Multiplayer FPS Shooter with a Single Player Part of the Shooter
@renzocfn4669
@renzocfn4669 3 жыл бұрын
Best coding tutorial channel I've ever seen in this world!
@Gathrey
@Gathrey 7 жыл бұрын
Thanx Brackeys. Good efficient tutorial. Exactly what I was looking for. Keep it up! Looking forward to future tutorials.
@КолянКоляныч-б1ь
@КолянКоляныч-б1ь 7 жыл бұрын
How to make a weapon appear when you pick it up and not just a full set of weapons? Good lessons, thank you.
@chaosmastermind
@chaosmastermind 4 жыл бұрын
You would set the weapons all to inactive and then make a power up collectible that activates only one type of weapon for each.
@ThatRazzy
@ThatRazzy 3 жыл бұрын
Hey were you able to figure this out?
@AshratAR
@AshratAR 7 жыл бұрын
I thought the whole process was much more difficult than this!! But this tutorial made it all simple!!!! Thanks!!
@chaosmastermind
@chaosmastermind 4 жыл бұрын
This is really useful and helpful. Thank you. Pretty much everyone that makes an FPS is going to need this.
@DavidAdochiti
@DavidAdochiti 3 жыл бұрын
we miss u brackeys! come back plzzz
@thelightningfurycore3901
@thelightningfurycore3901 3 жыл бұрын
I don't think he ever will. He is leaving youtube, forever (or is he?) But there is a chance that he will come back
@faisalsajjad7396
@faisalsajjad7396 7 жыл бұрын
thx brackeys loving this series
@alimirbagheri453
@alimirbagheri453 3 жыл бұрын
You are just so awesome. words cant describe how you help. thank you brackey,s i miss you a lot. and hope that you are living your dream wherever you are.
@ppnhzk
@ppnhzk 7 жыл бұрын
Nice tutorial as always. As I want to free up memory as much as I can, I do the switch by instantiating the weapon at a placed spawn point every time it is selected. Also, I store all the functions in the weapon object, even key presses like fire. It was easier because of the differences in their behaviour. After watching your tutorial however I might go with your method as it seems much more fluid in the end, though it might get heavy with 10+ weapons, so some testing might be needed. Not sure how much extra load the inactive stuff means.
@david35k
@david35k 5 жыл бұрын
Thank you! I really like your simple and clean tutorials! Very helpful
@RegenerationOfficial
@RegenerationOfficial 4 жыл бұрын
One of the most reused scripts Ive ever needed.
@artinmajidi1654
@artinmajidi1654 4 жыл бұрын
I had two animator components on my player, one for upper body and one for lower body. I made different controllers for each weapon and if that weapon is equipped, I simply switch animator controllers. Like this, I can do everything infinitely. And also, this took me a month to figure out. And another to do it.
@xiaobodong726
@xiaobodong726 5 жыл бұрын
Love your model, it’s so detailed
@WeaverKnight777
@WeaverKnight777 7 жыл бұрын
can we make an animation for weapon switching
@flashgames1273
@flashgames1273 7 жыл бұрын
also shooting/aiming animations!
@davidenale17
@davidenale17 7 жыл бұрын
Saad Tv yes will be nice to see it (and check if i'm doing it correctly)
@solomonlyons10
@solomonlyons10 7 жыл бұрын
Saad Tv It's really really simple, I think a few really good videos on KZbin goes over it. I feel like the only challenging part for a lot of people is the mecanim portion.
@JayAnAm
@JayAnAm 7 жыл бұрын
Actually it isn't that hard, will put it to my list.
@remove6796
@remove6796 7 жыл бұрын
switching with animations are easy you just need to make a default state anim and then make a sound fx play on awake and walla. you didn't understand did you? :(
@vanthele5623
@vanthele5623 9 ай бұрын
Thank you. The script is straightforward to understand
@TrifleWaffle
@TrifleWaffle 7 жыл бұрын
thank you! I waited for this for so long!
@AnuragJhaCreations
@AnuragJhaCreations 7 жыл бұрын
i watched 1 video of yours and my mouse automatically went to subscribe this guy
@lockedonbiome
@lockedonbiome 7 жыл бұрын
Could you do a tutorial on enemy ai with shooting
@BlackMesaEmployee
@BlackMesaEmployee 6 жыл бұрын
Boss Hog306 do you still need that tutorial? I’m considering making one
@sconosciutosconosciuto2196
@sconosciutosconosciuto2196 6 жыл бұрын
@@BlackMesaEmployee you don't make video :(
@anshivvv.vfx99
@anshivvv.vfx99 4 жыл бұрын
@@sconosciutosconosciuto2196 he said he was considering. Duh?
@theasin_old
@theasin_old 3 жыл бұрын
@@BlackMesaEmployee please
@ranger10301
@ranger10301 3 жыл бұрын
@@BlackMesaEmployee do it
@yikes1910
@yikes1910 7 жыл бұрын
been absolutely buzzing for this video since Wednesday
@GameS-lu2vz
@GameS-lu2vz 7 жыл бұрын
JammyDodger16 me too!
@mlgsquirrel
@mlgsquirrel 4 жыл бұрын
i used this for switching attachments, but instead of scroll wheel its a button. great video man
@Oliver_TGB
@Oliver_TGB 7 жыл бұрын
Really cool! I have an idea. How about you made a tutorial on how to make an ammo amount. In sense of being able to see how many bullets you can fire before there are none left and possibly a reloading animation.
@magnusm4
@magnusm4 7 жыл бұрын
Simple, short and easy as it should be for programming
@mrsparklepants5636
@mrsparklepants5636 7 жыл бұрын
HE MADE IT ATLAST I LOVE YOU BRACKEYS YOU ARE THE
@SuperManIsDope
@SuperManIsDope 7 жыл бұрын
Love the new thumb nails !
@doxel8691
@doxel8691 7 жыл бұрын
wow! I didn't know the transform class implemented the IEnumerator interface that returned the children, good to know. thanks brackeys!
@laurel8831
@laurel8831 7 жыл бұрын
I love your thumbnails by the way
@aaravagrawal8799
@aaravagrawal8799 3 жыл бұрын
Brackeys is so underrated
@FlyGuy8701
@FlyGuy8701 7 жыл бұрын
I really like the new thumbnails.
@justarandomguy9234
@justarandomguy9234 7 жыл бұрын
that feeling when you realize you put all the player variables (like health) in the shoot script and now u must break it apart
@seraphimsarecoool
@seraphimsarecoool 4 жыл бұрын
lol thats pretty easy to remove and CTR+V to a new script lol its been 3yrd
@nuclearbomb9483
@nuclearbomb9483 3 жыл бұрын
@@seraphimsarecoool ctrl x
@Random-uo8sp
@Random-uo8sp 5 жыл бұрын
You have no right to be so good
@NakaLore
@NakaLore 5 жыл бұрын
I used this for character swapping on my game. It is awesome!
@NakaLore
@NakaLore 5 жыл бұрын
Ok, it works and it doesn’t work at the same time. The characters switch, but only at the position of the parent object. But I dunno how to make them appear at right position.
@icantth1nkofanam40
@icantth1nkofanam40 4 жыл бұрын
@@NakaLore make a script that changes their position?
@woofiewill
@woofiewill 7 жыл бұрын
When you want to restrict an index to a range of numbers (like wrapping the index back to 0 when incrementing) it's almost always better practice to use modulus. Write `selectedWeapon = (selectedWeapon + 1) % transform.childCount` instead. This is a slight performance increase over using an if statement, and it's much more succinct. Even better would be this (I'll use some slight pseudocode): if (scrollUp) selectedWeapon++; else if (scrollDown) selectedWeapon--; selectedWeapon = selectedWeapon % transform.childCount; This way it's much simpler and you only need to apply modulus once to make sure the variable stays in your desired range.
@purpleguy9002
@purpleguy9002 5 жыл бұрын
Thanks Brackeys! I love your videos!
@GoldenGamer26
@GoldenGamer26 7 жыл бұрын
Best tutorial channel, why dislikes!?!
@PandeyJiGames
@PandeyJiGames 7 жыл бұрын
thnx a loot brackeys, awesome video again...
@Hasnain1F
@Hasnain1F 5 жыл бұрын
I am not even a Game Developer. Full-stack web developer instead but I love watching these videos! Why don't you make a game development course on Udemy? I am sure you will sell tons of it!!
@Incognitus30
@Incognitus30 5 жыл бұрын
Because, as stated in his description "All content by Brackeys is 100% free. I believe that education should be available for everyone. Any support is truly appreciated so I can keep on making the content free of charge." Making a payed course on Udemy would pretty much make him a full on hypocrite.
@seifmustafa2004
@seifmustafa2004 7 жыл бұрын
your tutorials are super awesome 🙆
@drimihq7724
@drimihq7724 4 жыл бұрын
H,i I just started with Unity and C# last week and your videos are really helping me. I was wondering whether you could use a for loop instead of having to copy paste the "if statements" and whether it's beneficial (Timestamp 9:00) I used an array for the keycodes like this private UnityEngine.KeyCode[] Keycodes = {KeyCode.Alpha1, KeyCode.Alpha2, KeyCode.Alpha3, KeyCode.Alpha4, KeyCode.Alpha5, KeyCode.Alpha6, KeyCode.Alpha7, KeyCode.Alpha8, KeyCode.Alpha9, KeyCode.Alpha0}; and then I used a for loop and it works fine for (int i = 0; i
@Viski982
@Viski982 2 жыл бұрын
Thanks man.
@ЄвгенГавриловський
@ЄвгенГавриловський Жыл бұрын
Thank you, I tried it and it really worked and this code is not massive. However, I should specify that in my case it worked when I declared in "Update" method KeyCode array without "private" together with loop between "if" statements for mouse scroll wheel switching and if (previousWeapon != selectedWeapon).
@systematicloop3215
@systematicloop3215 7 жыл бұрын
In the foreach statement in the SelectWeapon method, you could have simply said SetActive(selectedWeapon == i) instead of routing it to separate if statements.
@thevikaskandari
@thevikaskandari 4 жыл бұрын
Now that's called a awesome tutorial
@JustKatoh
@JustKatoh 7 жыл бұрын
Thank you for the video, i have learned a lot
@gametips7627
@gametips7627 5 жыл бұрын
All the way first class tutorial. Love your tutorial
@craze52
@craze52 7 жыл бұрын
You are one of the best youtuber for scripting and youtube
@Kanal994
@Kanal994 7 жыл бұрын
Great tutorials. Cheers !
@emerickdorval3713
@emerickdorval3713 3 жыл бұрын
Barckeys you are my idole i like you so much i love your tutorials they teach me allot
@lucasgamesfr6s5
@lucasgamesfr6s5 3 жыл бұрын
i really love the idea of pay what you want or grab it for free. I'm very sorry that i can't afford to support the model developpers but i'm grateful i can still use their creations
@alphachicken3225
@alphachicken3225 7 жыл бұрын
Brackeys please do a tutorial (or tutorials) on 2D procedural generation with blocks, similar to Terraria or Starbound.
@lordofpenutbutter
@lordofpenutbutter 2 жыл бұрын
i think theres a tutorial about that on Sebastian league's channel
@Notchmods
@Notchmods 6 жыл бұрын
Thanks a lot sensei brackeys
@NachoMan154
@NachoMan154 2 жыл бұрын
4:15 you could write that in one line: weapon.gameobject.SetActive(i == selectedWeapon);(instead of lines 22-25) should also be faster!
@DeaMikan
@DeaMikan 7 жыл бұрын
loved it! can you make a tutorial all about post processing effects on the camera!
@bransoncostin2070
@bransoncostin2070 2 жыл бұрын
Thank you so much this helps me in my farming game!
@qweqweqwqeqweewe5218
@qweqweqwqeqweewe5218 2 жыл бұрын
why the fuck do you need a weapon in a farm game. wtf bro.
@bransoncostin2070
@bransoncostin2070 2 жыл бұрын
Don't ask questions...
@blaizefar45
@blaizefar45 7 жыл бұрын
Another Great Tutorial
@magnusm4
@magnusm4 7 жыл бұрын
I like this way of making weapons best as it allows me to make each individual gun unique and not have to include every single stat on a single constructor file as some guns might be fired once or be selected as an ability so fire rate would be useless. Though i'm planning on having more than 30 or even 60 different weapons
@ildarildar1546
@ildarildar1546 6 жыл бұрын
thank you Brackeys you rea lly helped me
@punisherioi
@punisherioi 4 жыл бұрын
Hello Brackeys, can you make a Weapon pick up tutorial please, like picking a weapon by pressing 'F' and and 'Q' to drop. To be simple, like COD weapon picking...(pick, drop, swap)... your videos are really amazing and easy to understand... thanks...
@ThatRazzy
@ThatRazzy 3 жыл бұрын
Hey did you figure this out? I'm trying to do the same thing :)
@lars-sorensen
@lars-sorensen 7 жыл бұрын
Elsker disse simple tutorials!
@ashwinanand4208
@ashwinanand4208 7 жыл бұрын
can you connect this to the fps series please
@remysadventures-official8357
@remysadventures-official8357 7 жыл бұрын
Cool man! Btw a local Splitscreen tut? Just asking
@numadeveloper
@numadeveloper 16 күн бұрын
3:17 Brackeys farting is the last thing I expected to hear today...
@tatepayton7368
@tatepayton7368 2 жыл бұрын
Very helpful for both 2D and 3D
@farrukhkamal2315
@farrukhkamal2315 4 жыл бұрын
Very good tutorial, helped me alot. Can you make a tutorial on how to add animations when switching weapons.Thanks again
@NiteHawkk123
@NiteHawkk123 6 жыл бұрын
Amazing tutorial!
@sanderhoel6289
@sanderhoel6289 7 жыл бұрын
i find it quite funny how I have been struggling on an fps for half a year now, and boom you just solved all my problems.. p.s: i am sort of a beginner and the fps is not that complicated :)
@matarloum2894
@matarloum2894 7 жыл бұрын
This is working for you on uNet ??
@andreig2946
@andreig2946 7 жыл бұрын
Hey can you make a video about how to make a car moove? Great job on your videos man!
@willmathonsi2286
@willmathonsi2286 7 жыл бұрын
Another brilliant video Asbjørn. Any idea on how to do ammo switching?
@jahangirakbar4524
@jahangirakbar4524 7 жыл бұрын
your Channel is awesome! I am your Subscriber! Everything I need is Already Available on this Channel. Highly Recommended to Everyone!
@hackermub2598
@hackermub2598 5 жыл бұрын
5:50 well we can easily do that by selectedWeapon++; selectedWeapon%=transform.childCount; That means whenever selectedWeapon gets to the limit.. it will be set to 0
@xXLanyuzAnlunXx
@xXLanyuzAnlunXx 5 жыл бұрын
its just to make the beginners understand
@we2000h
@we2000h 6 жыл бұрын
You are a great guy !! Love you
@migueldast8812
@migueldast8812 7 жыл бұрын
Great job! You are awesome! I ask you a question becouse i need help with my game. If i have not pick up the weapons yet, how can i activate the script (of weapon switching) after that? NOTE: I have the weapons in trigger box for seleccion. Please i need to solve it! Thanks!
@kaiser9321
@kaiser9321 7 жыл бұрын
A better way for wrapping around would be using variable % number, I remember using it in another coding language but I'm not sure if it works in C#, get back to me on that, thanks
@mastai7624
@mastai7624 6 жыл бұрын
You are m'y best teacher with you i Can understand
@BenignoFilippo
@BenignoFilippo 2 жыл бұрын
Congrats!!! When did you first start investing
@LLITALKER
@LLITALKER 7 жыл бұрын
Ingeniously and simply !!!
@hiddeloman1967
@hiddeloman1967 7 жыл бұрын
Do you have a new thumbnail style or is it just for this type of video's? The look really cool!!!
@atlasthetitan5110
@atlasthetitan5110 7 жыл бұрын
Nice video, could you make a ammo mechanic, like have some script count to a certain number then like disable the shooting script until you press the reload button, it could also trigger an animation
@randomguy-gb9ge
@randomguy-gb9ge 2 жыл бұрын
I have something like that, if you want check out this tutorial:kzbin.info/www/bejne/pZ6QhIZjeKeNbsk
@abluecherry7937
@abluecherry7937 6 жыл бұрын
you could also make it so if the gun isn't in view the gun wont fire then you could make a cube that has all 3 guns attached to it and it spins a certain amount when you press a button
@frostymug3123
@frostymug3123 2 жыл бұрын
Great tutorial thank you!
@julianpizano5586
@julianpizano5586 7 жыл бұрын
Great tutorial! but I have a problem... The weapons that I have attached to the character controller aren't part of a weapon holder game object. (they are just children of the main camera) if I try to child the weapons to an empty game object, the positions of the weapons change... this causes the weapon animations to change drastically. Is there a way to child the weapons to an empty game object (weapon holder) without changing the position of the weapons themselves??????? plz reply!
@chaosmastermind
@chaosmastermind 4 жыл бұрын
You do have to add the number keys code for each weapon you add though. You don't need to add it for the mouse wheel though. There are ways to make that automated, but it's better not to get into it for a beginner tutorial.
@EDemircivi
@EDemircivi 7 жыл бұрын
Simple & effective, thank you for your tutorials. Keep it up, and don't mind your view counts, you're great :).
@LorcanG
@LorcanG 4 жыл бұрын
i added a transition to it so its not static using UnityEngine; using System.Collections; public class WeaponSwitching : MonoBehaviour { public int selectedWeapon = 0; public float WeaponSwitchSpeed = 5f; public Vector3 position1; public Vector3 position2; public GameObject weapon1; public GameObject weapon2; public GameObject weapon3; public bool Selected1; public bool Selected2; public bool Selected3; void Start() { StartCoroutine(SelectWeapon()); } void Update() { int i = 0; int previousSelectedWeapon = selectedWeapon; if (Input.GetAxis("Mouse ScrollWheel") < 0f) { if (selectedWeapon >= transform.childCount - 1) selectedWeapon = 0; else selectedWeapon++; } if (Input.GetAxis("Mouse ScrollWheel") > 0f) { if (selectedWeapon = 2) { selectedWeapon = 1; } if (Input.GetKeyDown(KeyCode.Alpha3) && transform.childCount >= 3) { selectedWeapon = 2; } if (previousSelectedWeapon != selectedWeapon) { StartCoroutine(SelectWeapon()); SelectWeapon(); } #region Selection bools if (selectedWeapon == 0) { Selected1 = true; } else { Selected1 = false; } if (selectedWeapon == 1) { Selected2 = true; } else { Selected2 = false; } if (selectedWeapon == 2) { Selected3 = true; } else { Selected3 = false; } #endregion #region transitions if(Selected1 == true && weapon1.activeSelf == true) { weapon1.transform.localPosition = Vector3.Lerp(weapon1.transform.localPosition, position1, WeaponSwitchSpeed * Time.deltaTime); } else { weapon1.transform.localPosition = Vector3.Lerp(weapon1.transform.localPosition, position2, WeaponSwitchSpeed * Time.deltaTime); } if (Selected2 == true && weapon2.activeSelf == true) { weapon2.transform.localPosition = Vector3.Lerp(weapon2.transform.localPosition, position1, WeaponSwitchSpeed * Time.deltaTime); } else { weapon2.transform.localPosition = Vector3.Lerp(weapon2.transform.localPosition, position2, WeaponSwitchSpeed * Time.deltaTime); } if (Selected3 == true && weapon3.activeSelf == true) { weapon3.transform.localPosition = Vector3.Lerp(weapon3.transform.localPosition, position1, WeaponSwitchSpeed * Time.deltaTime); } else { weapon3.transform.localPosition = Vector3.Lerp(weapon3.transform.localPosition, position2, WeaponSwitchSpeed * Time.deltaTime); } #endregion } IEnumerator SelectWeapon() { yield return new WaitForSeconds(1f); int i = 0; foreach (Transform weapon in transform) { if (i == selectedWeapon) weapon.gameObject.SetActive(true); else weapon.gameObject.SetActive(false); i++; } } }
@LorcanG
@LorcanG 4 жыл бұрын
keep the position 1 at 0x 0y 0z and for position 2 x0.5 y-0.5 z-0.5 worked for me
@atomicalex1732
@atomicalex1732 4 жыл бұрын
bro thats awesome, thanks
@Markleap
@Markleap 2 жыл бұрын
my gun go in my head, how would i fix?
@LorcanG
@LorcanG 2 жыл бұрын
@@Markleap move the game object coordinates (the gun) forward
@AZASeraph
@AZASeraph 2 жыл бұрын
For whatever reason it works when I scroll, but not with the keys and I've made sure it's the right code and all too
@nikodemhamrol9025
@nikodemhamrol9025 4 жыл бұрын
So if I had like 50 weapons in the game, how would you then go about handling those weapons. In terms of getting the transformation correct, animations, loaded into the scene. Because I dont imagine someone using this method. Im not complaining on the video, it's a great tutorial if you small amounts of weapons, but my curiosity is how to handle a bunch of weapons
@gaminganimator-qp2ir
@gaminganimator-qp2ir 4 жыл бұрын
use the scroll wheel instead it will work fine then
@nikodemhamrol9025
@nikodemhamrol9025 4 жыл бұрын
@@gaminganimator-qp2ir so you would hold 50 weapons in one hand scroll through 50 weapons?
@gaminganimator-qp2ir
@gaminganimator-qp2ir 4 жыл бұрын
@@nikodemhamrol9025 yea
@nikodemhamrol9025
@nikodemhamrol9025 4 жыл бұрын
@@gaminganimator-qp2ir name a game that does that
@gaminganimator-qp2ir
@gaminganimator-qp2ir 4 жыл бұрын
@@nikodemhamrol9025 the game im working on
@mashoodkiyani3992
@mashoodkiyani3992 7 жыл бұрын
Your teaching style is amazing
@nikkiofthevalley
@nikkiofthevalley 4 жыл бұрын
oh god.. Just use Fusion 360, it's both easier to use and less time-consuming, but isn't free :(
@MARTOUFFF06
@MARTOUFFF06 7 жыл бұрын
Why not use the modulus operator when cycling the weapons ? Which solution is more optimized ?
@MaZyYTube
@MaZyYTube 5 жыл бұрын
Both are same. Compiler will change to same machine code. Its about readability or comfortably
@user-th8nx4cp7w
@user-th8nx4cp7w 4 жыл бұрын
For some people like me you might have this problem where when foreach the transform, it acess the transform on the WeaponSwitcher too, so when you use your scroll wheel and keep scrolling up, you could end up in a empty space where the player is holding nothing. To deal with that, I add - public Transform weaponSwitcher -, and under the foreach -if(weapon.transform.IsChildOf(weaponSwitcer)){//rest of the code}
Ammo & Reloading - Unity Tutorial
10:26
Brackeys
Рет қаралды 292 М.
I Made the Same Game in 8 Engines
12:34
Emeral
Рет қаралды 4,4 МЛН
100 DEVS Make a GAME without COMMUNICATING! (1-25)
17:14
Blackthornprod
Рет қаралды 2,2 МЛН
Weapon Switching in Unity | Weapon System #2
4:31
Plai
Рет қаралды 30 М.
Shooting with Raycasts - Unity Tutorial
13:41
Brackeys
Рет қаралды 1,9 МЛН
The 5 Stages of Learning Blender
3:14
Artin Azarnejad
Рет қаралды 348 М.
ADD ARMS TO YOUR GAME - EASIEST WAY (Unity3D)
15:22
JonDevTutorials
Рет қаралды 69 М.
Let's Program Doom - Part 1
25:13
3DSage
Рет қаралды 469 М.
FULL PICK UP & DROP SYSTEM for WEAPONS or ITEMS || Unity3d Tutorial
5:45
Dave / GameDevelopment
Рет қаралды 194 М.
3 Hours vs. 3 Years of Blender
17:44
Isto Inc.
Рет қаралды 7 МЛН