void Awake() { rb = ragdoll.body.GetComponent <Rigidbody2D> (); //GroundCheck groundChecks = GetComponentsInChildren <GroundCheck> (); /* * for(int i = 0; i < groundChecks.Length; i++) * { * groundChecks[i].SetPlayer(this); * } */ gun = GetComponent <PlayerGunScript> (); if (gun != null) { gun.SetPlayer(this); } //FuncItems for (int i = 0; i < funcItems.Length; i++) { funcItems [i].SetPlayer(this); } }