Hello!
I would like to spawn a player (maybe he dies and re-spawn) and then Cinemachine would set target on him and follow.
So I …
using Cinemachine;
public class SpawnManager : MonoBehaviour
{
public GameObject player;
public CinemachineVirtualCamera myCinemachine;
void Start()
{
Instantiate(player, new Vector3(-8f, -2f, 0), Quaternion.identity);
myCinemachine = GetComponent<CinemachineVirtualCamera>();
}
private void Update()
{
myCinemachine.Follow = GameObject.FindGameObjectWithTag("Player").transform;
}
}
Of course It does not work! I put it in Update so … may be it is always updating!
How can I assign the transform to follow to my camera?
thanks a lot as usual for your help! :*
Giovanni