I wanted help with visual studio code scripting i.e wanted to know how to solve error CS1513

ALPHA TECH 1 Reputation point
2021-02-17T13:25:40.857+00:00

Hi I wanted to know how can I solve the error CS1513 in unity

Here is the script please tell what is wrong

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

public class PlayerController : MonoBehaviour
{
public float speed = 0;

private Rigidbody rb;  

private float movementX;  
private float movementY;  

// Start is called before the first frame update  
void Start()  
{  
    rb = GetComponent<Rigidbody>();  
}  

private void OnMove(InputValue movementValue)  
{  
    Vector2 movementVector = movementValue.Get<Vector2>();  

    movementX = movementVector.x;  
    movementY = movementVector.y;  
}  

private void FixedUpdate()  
{  
    Vector3 movement = new Vector3(movementX, 0.0f, movementY);  

    rb.AddForce(movement * speed);  
}  

private void OnTriggerEnter(Collider other)  
{  
    if (other.gameObject.CompareTag("PickUp"))  
    {  
        other.gameObject.SetActive(false);  
    }  

    [SerializeField] private TextMeshProUGUI _textObject;  
    public static void UpdateScore(int newScore, TextMeshProUGUI _textObject) => _textObject.text = newScore.ToString();  

}  

69132-image.png

Community Center Not monitored
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Guido Franzke 2,191 Reputation points
    2021-02-17T13:48:41.59+00:00

    Hello,
    the error normally means, that a } is missing. Regarding your code, the class definition must be closed at the end with a }
    Regards, Guido

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.