Having error CS0201:

Hi I hope someone can help me here.
I was using a movement tutorial that was 4 years old

when I had error:

CS0201: Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement

using UnityEngine;

public class Movment : MonoBehaviour
{
   public CharacterController controller;
   public Transform cam;

   public float speed = 6f;

   public float turnsmoothtime = 0.1f;

   float turnSmoothVelocity;
    
   void Update()
   {
        float horizontal = Input.GetAxisRaw("Horizontal");
        float vertical = Input.GetAxisRaw("Vertical");
        Vector3 direction = new Vector3(horizontal, 0f, vertical).normalized;

        if(direction.magnitude >= 0.1f)
        {
            float targetAngle = Mathf.Atan2(direction.x, direction.z) * Mathf.Rad2Deg; + cam.eulerAngles.y;
            float Angle = Mathf.SmoothDampAngle(transform.eulerAngles.y, targetAngle, ref turnSmoothVelocity, turnsmoothtime);
            transform.rotation = Quaternion.Euler(0f, Angle, 0f);

            Vector3 moveDir = Quaternion.Euler(0f, targetAngle, 0f) * Vector3.forward;
            controller.Move(moveDir.normalized * speed * Time.deltaTime);
        }
   }
}

Look at line 24. You have an errant extra semi-colon.

I tried taking out that semi colon but then it said “error CS1002: ; expected”

Which done did you remove?

Each statement should send in a semicolon, but you have an extra one before the + symbol in the code below.

Mathf.Rad2Deg; + cam.eulerAngles.y;

Make sure when you follow the tutorial you correctly copy the code. If you have any errors, you need to take a closer look at what the tutorial wrote, and what you’ve written.

Thank you I did not see that semi colon