Erro CS0116 Unity

Unity

C#

09/08/2021

Preciso de ajuda!!! nao consigo tirar esse erro, ja tentei varias coisas, sei q o erro é obvio mas nao estou conseguindo.
error CS0116: A namespace cannot directly contain members such as fields or methods


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

public class NewBehaviourScript : MonoBehaviour
{
int velocidade = 300;
int poder = 800;
float peso = 70.5f;
}

// Start is called before the first frame update
void Start()
{
Debug.Log("Velocidade: " + velocidade);
Debug.Log("Poder de Ataque: " + poder);
Debug.Log("Peso: " + peso);
}

// Update is called once per frame
void Update()
{
Debug.Log("Velocidade: " + velocidade);
Debug.Log("Poder de Ataque: " + poder);
Debug.Log("Peso: " + peso);
}
Pegoraro

Pegoraro

Curtidas 0
POSTAR