i got
error CS1513: } expected
error CS1002: ; expected
error CS1525: Invalid expression term ‘}’
what do i do
my code is:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class player: MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
{if (input .GetKeyDown(KeyCode.Space) == true)
}// Check if space is down
{Debug.log("Space key was pressed.");
}
The compiler expects the code in a certain formal way to make sense of it (aka syntax). So you have to write it this way. When you can’t spot the errors yourself I STRONGLY suggest to learn basic C# programming first. A good start is the free C# Yellow Book by Rob Miles. If you know C# it’s IMO easier to dig into Unity.
Probably someone will tell you the exact reason of the errors but even when you can fix them now and don’t understand why this happens will only get you so far.
Also a good IDE should help with such stuff.
As a note to start your investigation. Curly braces have the meaning to put instructions together into a “block” of code. You have placed some of them in a non meaningfull way.
Edit: Kudos for using code tags from the start ;).