- Home /
Question by
mhunter1234 · Mar 25, 2016 at 05:51 PM ·
script.enemypolymorphism
need help with making an enemybase script. I need help with the enemy movement because I have three enemies in total and I need to polymorphically have each enemy attack and move. Thanks
using UnityEngine; using System.Collections;
public class EnemyBase : MonoBehaviour {
public Transform Player;
public Transform myEnemy;
public float rotationSpeed = 3f;
protected float speed;
void Awake()
{
myEnemy = transform;
}
void Start()
{
Player = GameObject.FindGameObjectWithTag("Player").transform;
}
// Update is called once per frame
void Update()
{
MoveTo();
}
public virtual void MoveTo()
{
}
}
Comment
Your answer
Follow this Question
Related Questions
Text wont show the distance to the nearest enemy 2 Answers
Enemy list wont update 0 Answers
Enemy AI passing through walls 1 Answer
SetDestination function error 0 Answers
An OS design issue: File types associated with their appropriate programs 1 Answer