46,182 questions
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
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
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();
}
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