The game object does not move when spawned…
Here is the code:
using UnityEngine;
using System.Collections;
public class MoveTrail : MonoBehaviour {
public int moveSpeed = 230;
public string PlayerTag = "Player";
private Vector2 PlayerPos;
void Start()
{
GameObject Target = GameObject.FindWithTag(PlayerTag);
PlayerPos = new Vector2(Target.transform.position.x, Target.transform.position.y);
Debug.Log(PlayerPos);
}
// Update is called once per frame
void Update() {
Vector3.MoveTowards(this.transform.position , PlayerPos, moveSpeed * Time.deltaTime);
}
}