Hey. I made a movement scripts and i have 2 errors:
Assets\Scripts\Movement.cs(12,30): error CS1002: ; expected
Assets\Scripts\Movement.cs(12,32): error CS1519: Invalid token ‘;’ in class, struct, or interface member declaration
Can someone help me?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Movement : MonoBehaviour
{
public float speed;
public float jump;
private void move;
private void Rigidbody2D rb;
// Start is called before the first frame update
void Start()
{
rb = GetComponent<Rigidbody2D>();
}
// Update is called once per frame
void Update()
{
move = Input.GetAxis("Horizontal");
rb.velocity = new Vector2(move * speed, rb.velocity.y);
if (Input.GetButtonDown("jump"))
{
rb.AddForce(new Vector2(rb.velocity.x, jump));
}
}
}