using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class GuitarBombController : MonoBehaviour
{
    public RuntimeAnimatorController [] Player1Anims;
    int temp = 0;
    private void OnTriggerEnter(Collider other)
    {


        if (other.gameObject.tag == "Player2")
        {
            other.gameObject.tag = "Player1";
            other.gameObject.GetComponent<NeutralRandomMove>().enabled = false;
            other.gameObject.GetComponent<Player1Controller>().enabled = true;
            other.gameObject.GetComponent<Player2Controller>().enabled = false;
            other.gameObject.GetComponent<SpriteRenderer>().color = Color.white;
            other.gameObject.GetComponent<Animator>().runtimeAnimatorController = Player1Anims[UnityEngine.Random.Range(0, 5)];
            other.gameObject.GetComponent<Rigidbody>().AddForce((new Vector3(UnityEngine.Random.Range(0f, 1f), UnityEngine.Random.Range(0f, 1f), 0)) * (UnityEngine.Random.Range(20, 25) * 1000));

        }
    }
}
