1
resposta

Está dando um erro estranho, "The namespace '<global namespace>' already contains a definition

todo o meu código using System.Collections; using System.Collections.Generic; using UnityEngine;

public class ControlaJogador : MonoBehaviour { public float Velocidade = 10;

// Update is called once per frame
void Update()
{
    float eixoX = Input.GetAxis("Horizontal");
    float eixoZ = Input.GetAxis("Vertical");

    Vector3 direcao = new Vector3(eixoX, 0, eixoZ);

    transform.Translate(direcao * Velocidade * Time.deltaTime);

    if(direcao != Vector3.zero)
    {
        GetComponent<Animator>().SetBool("Movendo", true);
    }
    else
    {
        GetComponent<Animator>().SetBool("Movendo", false);
    }
}

}

Erro: "Assets\Scripts\ControlaJogador.cs(5,14): error CS0101: The namespace '<global namespace>' already contains a definition for 'ControlaJogador'"

1 resposta

Oi, Clara, tudo bem?

Provavelmente você tem dois scripts com o mesmo nome de classe e isso tá causando esse problema.