Santi
b0be1fdd96
Player can throw rocks at enemy to slow them down. Enemy script split into two scripts, one for movement and one for detection. Added and edited some comments.
31 lines
639 B
C#
31 lines
639 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
//* General Comments or Finished Tasks
|
|
//TODO Tasks left to be done for game
|
|
//! Bugs or Issues
|
|
//? Questions or Suggestions
|
|
|
|
//* Detects if player is in range of enemy
|
|
public class detectionScript : MonoBehaviour
|
|
{
|
|
|
|
public bool playerInRange = false;
|
|
|
|
private void OnTriggerEnter(Collider other)
|
|
{
|
|
if(other.tag == "Player")
|
|
{
|
|
playerInRange = true;
|
|
}
|
|
}
|
|
private void OnTriggerExit(Collider other)
|
|
{
|
|
if(other.tag == "Player")
|
|
{
|
|
playerInRange = false;
|
|
}
|
|
}
|
|
}
|