Hi! So /i was writing my first code and there of course, I faced a problem.
The program says playermove.cs(17,2): error CS1002: ; expected
But the thing is that there is no code in this line, how could be that a problem?
Also, Im writing my code on Visual Studio Code, because for some reasons, I cannot download Visual Studio (and the newest Unity, because my software is older than required)
Please help!
My Code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class playermove : MonoBehaviour {
private Animator anim;
private SpriteRenderer sr;
private float speed = 3f;
// Use this for initialization
void Awake () {
anim = GetComponent<Animator>();
sr = GetComponent<SpriteRenderer>
}
// Update is called once per frame
void Update () {
Move();
}
void Move () {
float h = Input.GetAxisRaw("Horizontal");
if(h>0) {
// going to the right side
} else if(h<0) {
}else if(h == 0) {
}
}
} // class
Update: The error message doesn’t show anymore, now it just writes ‘All compiler errors have to be fixed…’. I googled it, didn’t find any problem, though.