A namespace cannot directly contain mambers such as fields or methods...

I get this error, if i type in private Rigidbody rb; and i really don’t know what the problem is. i already did this in other scripts and it worked every time.
Error Code: CS0116
PS.: it’s a C# projekt

You have to declare it inside a class. Example:

public class SomeScriptClass : MonoBehaviour
	private Rigidbody rb;

(if U R using Visual Studio or VS) be careful that inside the brackets that start from ...class... { | | | }
U can see those vertical bar → |
(those vertical bars are helpful)
look at those vertical bars from the beginning until the end (start from the beginning of the brackets)
when U finish looking at the vertical bars → | (when U reach the ending of → |)
U may see under it the ending of the bracket, erase it and rewrite it at the end of the script
(HINT: write everything except using, class, #if, #elif… inside a bracket → ...class... { | | | }