Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

760
Visualizações
the script don't inherit a native class that can manage a script unity

I'm a beginner programmer on c# and Unity. So I was making a grid system for my game and when I'm trying to add as a component every script in my unity project it prints this one error : "The script don't inherit a native class that can manage a script" I don't know what i need to do.Help me please if u can

//////////first script///////////////

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

public class Gird1 : MonoBehaviour
{
    private int width;
    private int height;
    private int[,] gridArray;

    public Gird(int width, int height)
    {
        this.width = width;
        this.height = height;
        gridArray = new int[width, height];
        Debug.Log(width + " " + height);
      }
}

////////second script////////////////////

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

public class Testing : MonoBehaviour
{

   private void Start()
   {
       Grid grid = new Grid(20, 10);
   }


   void Update()
   {

   }
}

image of grid

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Your first script is named "Gird" not "Grid".

Second Script:

public class Testing : MonoBehaviour
{
   public Gird1 gird1; // Assign in the inspector. We need an instance of Gird1

   private void Start()
   {
       if (gird1 == null) { // In case someone forgot to assign in the inspector
           gird1 = (Gird1)FindObjectOfType(typeof(Gird1)); // .. We'll search the scene
       }
       gird1.Gird(20,10); // Call the Gird() function on your gird1 instance
   }
}
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda