using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraFollow : MonoBehaviour {
public Transform CameraTr;
public Transform PlayerTr;
Vector3 CameraStartingPos = CameraTr.position;
void Start () {
}
// Update is called once per frame
void Update () {
CameraTr.position = PlayerTr.position + CameraStartingPos;
}
}
So the error comes in the “Vector 3 line” and I’m guessing Unity doesnt think of the position argument as a Vector and that’s why I can’t set CameraStartingPos as CameraTr.position.
Could anyone explain me if I’m doing anything wrong or It’s just not done this way? Thanks :D.