SHARE
TWEET

Untitled

a guest May 23rd, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Pickup function
  2. if(InTrigger == true)
  3.         {
  4.             if(other.gameObject.tag == "Player" && (Input.GetKeyDown(EquipKB) || Input.GetKeyDown(EquipGP)))
  5.             {
  6.                 if(GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerMovement>().currentWeapon == null)
  7.                 {
  8.                     print ("Primary Weapon pick up");
  9.  
  10.                     GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerMovement>().currentWeapon = gameObject;
  11.  
  12.                     transform.parent = primarySocket.transform;
  13.                     transform.localPosition = new Vector3(0, 0, 0);
  14.                     transform.localRotation = Quaternion.Euler(0, 0, 0);
  15.                     equipped = true;
  16.                     rigid.useGravity = false;
  17.                 }
  18.                 else if (GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerMovement>().currentWeapon != null)
  19.                 {
  20.                     print ("Secondary Weapon pick up");
  21.  
  22.                     GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerMovement>().secondaryWeapon = gameObject;
  23.  
  24.                     transform.parent = secondarySocket.transform;
  25.                     transform.localPosition = new Vector3(0, 0, 0);
  26.                     transform.localRotation = Quaternion.Euler(0, 0, 0);
  27.                     rigid.useGravity = false;
  28.                 }          
  29.             }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top