Quantcast
Viewing all articles
Browse latest Browse all 1488

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() { } }

Viewing all articles
Browse latest Browse all 1488

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>