Quantcast
Channel: Answers for "How to switch weapons?(c#?)"
Browsing all 6 articles
Browse latest View live

Answer by xt.xylophone

Everything is possible in Unity! Don't forget that :D Since your new Ill go over a pretty basic way. Add some sort of weapons, plural because it manages all weapons the player has, script to your...

View Article



Answer by nastasache

Here is another script example in C#: using UnityEngine; using System.Collections; public class Weapons : MonoBehaviour { public GameObject[] weapons; // push your prefabs public int currentWeapon = 0;...

View Article

Answer by xt-xylophone

Everything is possible in Unity! Don't forget that :D Since your new Ill go over a pretty basic way. Add some sort of weapons, plural because it manages all weapons the player has, script to your...

View Article

Answer by nastasache

Here is another script example in C#: using UnityEngine; using System.Collections; public class Weapons : MonoBehaviour { public GameObject[] weapons; // push your prefabs public int currentWeapon = 0;...

View Article

Answer by J-R-Wood

something like this might work better, let me know what you guys think. if(Input.GetKey(KeyCode.Tab)) { CycleWeapons(); } function CycleWeapons () { if (Shield) { melee.setactive } if (bow) {...

View Article


Answer by Cubemann

Hello, I do not know if this works, I just wrote this code directly into the forums. using UnityEngine; using System.Collections; public class WeaponSwitch : MonoBehaviour { public gameObject weapon1;...

View Article
Browsing all 6 articles
Browse latest View live




Latest Images