Does anyone know how to fix this?

So I am just starting with unity, I have made a player who is a sphere with a texture and a light source coming from it (don’t ask why) I followed a brackeys tutorial to help me get a camera to follow the player, whenever i hit play after setting a value, the sphere shoots off into the distance almost instantly, what do i do to make it follow the player instead of flying off at light speed?

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CameraController : MonoBehaviour {

    public Transform target;

    public float smoothSpeed = 0.125f;
    public Vector3 offset;

    void LateUpdate()
    {
        transform.position = target.position + offset;
    }

}

You probably assigned “target” to the camera itself instead of the player in the camera’s inspector. Set “target” to the player object, instead of the Camera object.

Alternatively you may have done something weird accidentally like parented the camera to the player or vice versa.

Thank you, that worked! :smile: