CameraMovement script errors

So I did exactly as said for the CameraMovement script, but it still shows these errors
image

I’m new to Unity and C#, so if anyone could explain, pls and thx

This is what my code looks like:

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

public class CameraMovement : MonoBehaviour
public GameObject followTarget;
public float moveSpeed;
{
    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        if (followTarget != null)
        {
            transform.position = Vector3.Lerp(transform.position,
              followTarget.transform.position, Time.deltaTime * moveSpeed);
        }

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

public class CameraMovement : MonoBehaviour
{
public GameObject followTarget;
public float moveSpeed;

    // Start is called before the first frame update
    void Start()

You need to move the { to before the variable definition.

This topic was automatically closed after 166 days. New replies are no longer allowed.