Keep getting error code CS1002 and I cant figuer out why

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Solvey

Hello,
I’m in the middle of writing some code, when I checked to see if it was working as intended I got a CS1002 error code and I don’t know why.
Note: GODOT Ver v3.5, Language: C#. I’m brand new to GODOT and still learning C#

Errors:
G:\The Stick Runners\TSR-Project\Character\Char.cs(33,66): ; expected
G:\The Stick Runners\TSR-Project\Character\Char.cs(39,77): ; expected

using Godot;
using System;

public class Char : KinematicBody2D
{
   // Declare member variables here. Examples:
   // NOTE: VECTOR(X,Y)

   public int isFalling = 4;
   public int isJumping = 2;
   public int isSliding = 3;
   public int isRunning = 1;
   Public int charState = 0;
   public float JumpSpeed = 5;
   public float currentHight = 0;
   public float maxHight = 20;
   // Called when the node enters the scene tree for the first time.

   public override void _Ready()
   {
	
   }

//  // Called every frame. 'delta' is the elapsed time since the previous frame.
public override void _Process(float delta)
{
	if (Input.IsKeyPressed((int)KeyList.Space)) and (charState = 1)
	{
		charState = isJumping;
		currentHight += JumpSpeed;
		this.Position += new Vector2(0 , -JumpSpeed);
	
		if (currentHight = maxHight) or (Input.IsKeyReleased((int)KeyList.Space))
		{
			charState = isFalling;
			currentHight -= JumpSpeed;
			this.Position += new Vector2(0 , JumpSpeed);
		}

	}
}
}
:bust_in_silhouette: Reply From: juppi

Line 13:

Public int charState = 0;

Public hast to be lowercase

Line 32:

if (Input.IsKeyPressed((int)KeyList.Space)) and (charState = 1)
  • Your missing a ) at the end
  • You have to use && and || , because and and or are not valid for boolean comparison.

Also line 38 is wrong.