Error cs1022

hello I am a novice programmer currently I am trying to make an enemy shoot a projectile at the player but I am told that an end of file is expected but I am sure that all the curly braces are there. can someone please help? this is the code

using UnityEngine;
public class Cloud_Bullet : MonoBehaviour { }

public class Nextfire { }

public class FireRate { }

{
[SerializeField]
GameObject FIREBALL_0;
public int FireRate;
public int NextFire;}

// Start is called before the first frame update
void start()
{
{
FireRate = 1f;
Nextfire = Time.time;

}

// Update is called once per frame
void Update()
{
CheckIfTimeToFire();
}
void CheckIfTimeToFire();

{
if (Time.time > NextFire)
{
Instantiate(Cloud_Bullet, Transform.position, Quaternion.identity);
Nextfire = Time.time + FireRate;
}
}
}

Please post your code using Code Tags. Makes it a lot easier for people to help.

Also, it looks like you open and close the class on the Same Line

using UnityEngine;
public class Cloud_Bullet : MonoBehaviour { }

public class Nextfire { }

public class FireRate { }

{
[SerializeField]
GameObject FIREBALL_0;
public int FireRate;
public int NextFire;}


// Start is called before the first frame update
void start()
{
{
FireRate = 1f;
Nextfire = Time.time;

}

// Update is called once per frame
void Update()
{
CheckIfTimeToFire();
}
void CheckIfTimeToFire();


{
if (Time.time > NextFire)
{
Instantiate(Cloud_Bullet, Transform.position, Quaternion.identity);
Nextfire = Time.time + FireRate;
}
}
}

oh I’m sorry, thanks

public class Cloud_Bullet : MonoBehaviour { } This line Opens and closes the class.

You also have several other errors;

Declare FireRate as an int, but assigning it a float
Declare NextFire as an int, but trying to use Nextfire (Notice the Capital F in the declaration, but lower case f in the usage) as a Time.time.

I would recommend Going here Unity C# Survival Guide - Unity Learn to brush up on c# and its uses in unity.

so should I get rid of it?

Well yes, the curly braces are there, but there is nothing inside of them.
All of your logic needs to be inside the curly braces of the class.

You’re also defining NextFire and FireRate as classes, when you appear to want to use them as variables as well. You can just remove those.

You may want to start with some beginner scripting tutorials to get familiar with the C# syntax first:

pls someone help me heres my script for player movement :

using UnityEngine;
public class PlayerMovement : MonoBehaviour
public CharacterController controller;
public float speed = 12f;
// Update is called once per frame
void Update()
{
float x = Input.GetAxis(“Horizontal”);
float z = Input.GetAxis(“Vertical”);
Vector3 move = transform.right * x + transform.forward * z;
controller.Move(move * speed * Time.deltaTime);
}
}

error : Assets\PlayerMovement.cs(18,1): error CS1022: Type or namespace definition, or end-of-file expected

@Zapp36

Probably not a good idea to post your question into some old thread, even if you got the same error.

Usually it is best to start you own thread and use code tags .

But in this case, if you actually had read the posts, you would have found out the reason for your error…

And If you had used code tags and your code was properly indented, it would be obvious you are missing (at least) a “{” in the beginning of your class definition.