FragMate CommunityLog in

FragMate - Software and Game Developer Community, including Resources, Forums, Marketplace & More.

Share

descriptionWeapon Switching Script

more_horiz
I found this excellent script, I didn't make.
[You must be registered and logged in to see this link.]

If anyone is wondering...... you have to create an empty and sometime has to rotate the empty, put the script and then drag what guns you want



Cool

descriptionRe: Weapon Switching Script

more_horiz
Great share!

descriptionScript update

more_horiz
I fixed this script to work with Unity 5 c:

Code:


var gun1 : GameObject;
var gun2 : GameObject;
 
 function Update(){
 if(Input.GetButtonDown("SwitchWeapons"))
   SwapWeapons();
 }
 
 function SwapWeapons(){
 if (gun1.active == true) {
 gun1.SetActive(false);
 gun2.SetActive(true);
 } else {
 gun1.SetActive(true);
 gun2.SetActive(false);
 }
 }

descriptionRe: Weapon Switching Script

more_horiz
Personally unity 5 lags me out so i stuck with unity 4.6.2 not really missing out on much

also thanks for the script!

Last edited by Outboundstream4 on Tue Jul 07, 2015 6:41 pm; edited 1 time in total (Reason for editing : forgot to put something in)

descriptionRe: Weapon Switching Script

more_horiz
I already made a switch weapon script,but is useful thanks

_________________
Game Developer
YouTube Channel: [You must be registered and logged in to see this link.]
Website: [You must be registered and logged in to see this link.]

Permissions in this forum:
You cannot reply to topics in this forum