Instead what I did results in pretty much the same, but instead in code.
What I did is get the offset between the camera and the anchoring object (the FollowCamera
object which I placed at the scene’s origin), and inside Update()
apply this offset to the camera’s position as well:
public class FollowCamera : MonoBehaviour
{
[SerializeField] private Transform followTargetObject;
private Transform mainCameraTransform;
private Vector3 anchorOffset;
private void Start()
{
mainCameraTransform = Camera.main.transform;
anchorOffset = mainCameraTransform.position - transform.position;
}
void Update()
{
transform.position = followTargetObject.position;
mainCameraTransform.position = transform.position + anchorOffset;
}
}