Hello. I have one virtual camera and I want this camera to follow and look to my player as soon at the player appears in the game. While the player appears I have an empty object set into the follow and LookAt variables in the Virtual Camera. I have a script that waits until the player appears and then changes the transform to target the player. I see in the inspector that the virtual Camera is actually changing the transform but as soon as I move the player the camera doesn’t follow nor looks at the player. This is the code I’m using:
public GameObject player;
public Transform PlayerStartPosition;
public CinemachineVirtualCamera virtualCamera01;
Thanks Gregory. I just found the problem. The script reference I’m using was pointing to a player prefab and not the instantiated player in the game. So I create a new transform that looks for the actual player and now the Vcam is working. See the code:
Transform playerToFollow;
public GameObject player;
public Transform playerStartPosition;