okay I am trying to make an enemy spawn and move twords my players position when it was spawned but it keeps going in weird directions for some reason
using UnityEngine;
using System.Collections;
public class enemymove : MonoBehaviour {
Vector3 myv;
public GameObject player;
// Use this for initialization
void Start () {
player = GameObject.FindGameObjectWithTag ("playerShip");
myv = player.transform.position;
player.transform.rotation = transform.rotation;
}
// Update is called once per frame
void Update () {
transform.Translate (myv * 1 * Time.deltaTime);
}
}
any help would be aprecated thanks