Assets\PlayerController.cs(37,31): error CS1002: ; expected

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

public class PlayerController : MonoBehaviour
{
public float moveSpeed = 5f;
public Rigidbody2D rb;
public Weapon weapon;

Vector2 moveDirection;
Vector2 mousePosition;

// Update is called once per frame
void Update()
{
float moveX = Input.GetAxisRaw(“Horizontal”);
float moveY = Input.GetAxisRaw(“Vertical”);

if(Input.GetMouseButtonDown(0))
{
weapon.Fire();
}

moveDirection = new Vector2(moveX, moveY).normalized;
mousePosition = Camera.main.ScreenToWorldPoint(Input.mousePosition);

}

private void FixedUpdate()
{
rb.velocity = new Vector2(moveDirection.x * moveSpeed, moveDirection.y * moveSpeed):

Vector2 aimDirection = mousePosition - rb.position;
float aimAngle = Mathf.Atan2(aimDirection.y, aimDirection.x) * Mathf.Rad2Deg - 90f
rb.rotation = aimAngle
}
}

my error is: Assets\PlayerController.cs(37,31): error CS1002: ; expected

That error means “You are making typing mistakes.”

You can fix those yourself by reading the error. Here’s how:

The complete error message contains everything you need to know to fix the error yourself.

The important parts of the error message are:

  • the description of the error itself (google this; you are NEVER the first one!)
  • the file it occurred in (critical!)
  • the line number and character position (the two numbers in parentheses)
  • also possibly useful is the stack trace (all the lines of text in the lower console window)

Always start with the FIRST error in the console window, as sometimes that error causes or compounds some or all of the subsequent errors. Often the error will be immediately prior to the indicated line, so make sure to check there as well.

Look in the documentation. Every API you attempt to use is probably documented somewhere. Are you using it correctly? Are you spelling it correctly?

All of that information is in the actual error message and you must pay attention to it. Learn how to identify it instantly so you don’t have to stop your progress and fiddle around with the forum.

Remember: NOBODY here memorizes error codes. That’s not a thing. The error code is absolutely the least useful part of the error. It serves no purpose at all. Forget the error code. Put it out of your mind.

Declaration statements and expression statements are terminated with a semicolon.

A declaration statement is anything of this form:

TypeName variableName;
TypeName variableName = someValue;

An expression statement is anything of this form:

variableName = someValue;

Correct your code accordingly.