// Use this for initialization void Awake() { p1Chain = player1.GetComponent <ChainScript> (); p2Chain = player2.GetComponent <ChainScript> (); p3Chain = player3.GetComponent <ChainScript> (); p4Chain = player4.GetComponent <ChainScript> (); }
// Update is called once per frame void Update() { if (chain == null) { chain = transform.GetComponentInParent <ChainScript> (); source = chain.GetComponent <AudioSource> (); } }