You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
598 B

  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class KillZone : MonoBehaviour
  5. {
  6. public HerdController herd;
  7. // Start is called before the first frame update
  8. void Start()
  9. {
  10. herd = FindObjectOfType<HerdController>();
  11. }
  12. private void OnTriggerEnter(Collider other)
  13. {
  14. Debug.Log("Hit");
  15. PlayerController horse = other.GetComponent<PlayerController>();
  16. if (horse != null)
  17. herd.RemoveHorse(horse);
  18. }
  19. // Update is called once per frame
  20. void Update()
  21. {
  22. }
  23. }