Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Error CS1519: Invalid token '=' in class, struct, or interface member decla

Discussion in 'Getting Started' started by Haredrop, Apr 1, 2020.

  1. Haredrop

    Haredrop

    Joined:
    Apr 1, 2020
    Posts:
    1
    Code (CSharp):
    1. using UnityEngine;
    2.  
    3. public class player : MonoBehaviour
    4. {
    5.     public float speed;
    6.  
    7.     private Rigidbody2D body;
    8.  
    9.     private Vector2 moveVelocity;
    10.  
    11.     void Start()
    12.     {
    13.         rb = GetComponent<Rigidbody2D>();
    14.      }
    15.  
    16.     void Update();
    17.     Vector2 moveInput = new Vector2(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical"));
    18.         MoveVelocity = MoveInput.normalazed * speed;
    19.     }
    20.    
     
  2. Bill_Martini

    Bill_Martini

    Joined:
    Apr 19, 2016
    Posts:
    445
    You're missing an opening curly bracket in your Update method.