cs1002 ;expected 12,33 error

I looked at the code and found where i think the error was but its still popping up

here is the code

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class move : MonoBehaviour
{
    public Rigidbody2D rb;
    public float movespeed;
    public float jumpheight;
    public bool grounded;
    public Transform groundcheck;
    public layermask groundlayer;

    public void Update(){
        grounded = overlapcircle(groundcheck.position, .2f, groundlayer);
        rb.velocity = new vector2(input.getaxis("horizontal") * movespeed * Time.deltaTime, rb.velocity.y);

        if (grounded) {
       
            if (input.GetKeyDown(KeyCode.UpArrow)){
                rb.addforce(new vector2(0, jumpHeight), ForceMode2D.impulse);
            }
        }
    }
}

please help!!

  • Please use code tags to make your code more readable on the forums: Using code tags properly
  • I see a semicolon in your Update() method declaration that shouldn’t be there. Between the empty argument list and the opening curly brace (Compare yours to any example on the internet)

i deleted that but it is still showing the error

Please include the entire error message.

First off, it contains a description that is meaningful to people. “CS1002” is meaningless, nobody memorizes error codes.

Second, it contains a line number that will point to location of the error.

Additionally, your editor should be highlighting the problem for you.

Looks like some case problems too

layermask should be Layermask

overlapcircle should be OverlapCircle

input.getaxis should be Input.GetAxis

addforce should be AddForce

ForceMode2D.impulse should be ForceMode2D.Impulse

Be sure to post the full error and insert your code in to future posts, it makes it easier to work things out :slight_smile:

1 Like

thanks alot, brand new to coding, my 2nd day and first thread