20 lines
561 B
C#
20 lines
561 B
C#
//\$ Copyright 2015-22, Code Respawn Technologies Pvt Ltd - All Rights Reserved \$//\n
|
|
using UnityEngine;
|
|
using DungeonArchitect.Navigation;
|
|
|
|
namespace JackRabbit {
|
|
public class FollowPlayer : MonoBehaviour {
|
|
DungeonNavAgent agent;
|
|
// Use this for initialization
|
|
void Start () {
|
|
agent = GetComponent<DungeonNavAgent>();
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void FixedUpdate () {
|
|
var player = GameObject.FindGameObjectWithTag(DungeonArchitect.Samples.ShooterGame.GameTags.Player);
|
|
agent.Destination = player.transform.position;
|
|
}
|
|
}
|
|
}
|