Is there any way to store a transform position in a prefab, so that when the object is spawned or you put it in a different scene, it always follows the same object? This is the script:
EDIT- I attempted to make it follow the tagged object but I get errors.
using UnityEngine;
using System.Collections;
public class BStandard : MonoBehaviour
{
//public Transform playerPos;
Vector3 chaseVel, chaseDir, chasPos;
void Start() { chaseVel = new Vector3(10f, 0f, 10f);
playerPos = GameObject.FindWithTag("Player");}
void LateUpdate()
{
chaseDir = playerPos.position - transform.position;
Vector3 tmpNormalizedDir = Vector3.Normalize(chaseDir);
chaseDir = new Vector3(tmpNormalizedDir.x * chaseVel.x, tmpNormalizedDir.y * chaseVel.y, tmpNormalizedDir.z * chaseVel.z);
chaseDir *= Time.deltaTime;
this.transform.position += chaseDir;
}
}