Hi.
I have been trying to get a prefab instantiate and then follow a gameobject in C#.
The prefab is instantiated in the script that is attached to the gameobject, but the prefab doesn’t change its position once it has been instantiated.
void Start ()
{
Vector3 firePosition = new Vector3(transform.position.x, transform.position.y, transform.position.z);
Instantiate(FirePrefab, firePosition, Quaternion.identity);
}
I have tried to put the firePosition in the update function, but I am not sure how to get that to work (Is that even the right way to do it?)
Does anyone know how I can do this?
Thanks in advance