// Start is called before the first frame update private void OnTriggerEnter2D(Collider2D other) { if (other.tag == "Player") { player = GameObject.FindWithTag("Player").GetComponent <PlayerPl>(); FindObjectOfType <SoundsManager>().Play("Trap"); player.dead(); } }
// Start is called before the first frame update void Start() { //FindObjectOfType<SoundsManager>().Play("Saw"); base.Start(); player = GameObject.FindWithTag("Player").GetComponent <PlayerPl>(); body = GetComponent <Rigidbody2D>(); body.freezeRotation = true; if (body.velocity.magnitude == 0) { body.velocity = default_vector; } set_velocity(); }
// Start is called before the first frame update void Start() { player = GameObject.FindWithTag("Player").GetComponent <PlayerPl>(); }