HI Nina,
My camera doesn’t lock onto the car when I push play. I moved it over to the car just to make sure i had the camera distance and frame size right. ThingToFollow is set to my car. The camera does move with my wasd keys but, it doesn’t follow the car really and moves very slowly
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class FollowCamera : MonoBehaviour
{
[SerializeField] GameObject thingToFollow;
//movement speed in units per second
private float movementSpeed = 5f;
void LateUpdate()
{
//get the Input from Horizontal axis
float horizontalInput = Input.GetAxis("Horizontal");
//get the Input from Vertical axis
float verticalInput = Input.GetAxis("Vertical");
//update the position
transform.position = transform.position + new Vector3(horizontalInput * movementSpeed * Time.deltaTime, verticalInput * movementSpeed * Time.deltaTime, 0);
//output to log the position change
Debug.Log(transform.position);
}
}