started building logics for enemy
This commit is contained in:
23
Assets/Darkmatter/Code/Presentation/Enemies/EnemyMotor.cs
Normal file
23
Assets/Darkmatter/Code/Presentation/Enemies/EnemyMotor.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.AI;
|
||||
|
||||
namespace Darkmatter.Presentation
|
||||
{
|
||||
public class EnemyMotor : MonoBehaviour
|
||||
{
|
||||
[SerializeField] NavMeshAgent enemyAI;
|
||||
public Transform playerTransform;
|
||||
|
||||
[Header("Enemy Data")]
|
||||
public float walkSpeed = 3f;
|
||||
public float chaseSpeed = 5f;
|
||||
public float visionRange = 15f;
|
||||
public float attackRange = 2f;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
enemyAI.SetDestination(playerTransform.position);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: df95acdebfef05045a08adb2e752fd26
|
||||
Reference in New Issue
Block a user