- Home /
Do you know the solution of this probelm? (Problem is in the details)
Each time I use the "public" function, it shows me this error message: Assets\PlayerMovements.cs(5,18): error CS0116: A namespace cannot directly contain members such as fields or methods My function is: public Rigidbody rb; Is there like a new way of making this function? Note: I am a beginner and I am trying to learn game development with unity and C#.
Comment
thats not a functions, thats a variable, and variable (and functions) need to be inside a class like
public class Example : $$anonymous$$onoBehaviour{
public RigidBody body;
}