Give Among Us A Weapon Pistol & Shotgun | Game Clone Made In Unity Software | Weapon Switch Feature

Аватар автора
ZOTOV
#UnityWeaponSwitch Episode 2. Give Among Us A Weapon Pistol & Shotgun. Hi! In a previous video I created this running spaceman like in Among Us Game. In this video I give him a couple of guns (Pistol and Shotgun) and let him switch them by pressing a button. Get this gaming mouse for the price and win! Logitech G203 Wired Gaming Mouse TO BLAST! - My New Fun Relaxing Puzzle Game Available On Google Play Store If you like what I&doing then you can support me through or here Thank you) Hi! In a previous video I created this running spaceman. In this video I give him a couple of guns and let him switch them by pressing a button. So this is the previous project (link to that video is in the description). What new here is a couple of weapon sprites. Pistol and shotgun. Bring them to the scene. There we go. Weapons are a little too big so I scale them down. OK. Shotgun and pistol will be carried about here. So to give spaceman a weapon I need to instantiate it. To instantiate a gameobject I need a prefab of it. Prefabs will be loaded from Resources folder. So I create one in Assets folder. It’s very important not to make a typo in the folder name. One mistake and it will not work. Folder is created and I D&D pistol and shotgun gameobjects into it making them prefabs. I can delete these gameobjects from hierarchy. To instantiate a weapon, to give it a correct position and other stuff I use a script. Here it is. Boring variables here. Fun begins in Update method. If Q button...

0/0


0/0

0/0

0/0