I am trying to make a script for my First person game where it makes the player jump. When I’m in Unity it shows an error stating Assets\Scripts\PlayerJump.cs(19,2): error cs1513: } expected. I am very confused to what all that means. My script is down below. Thanks for any feedback. (I’m using Visual Studio 2019)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerJump : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
if(Input.GetKeyDown (KeyCode.Space)) {
GetComponent ().AddForce (Vector3.up * 2000);
}
}