Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

764
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda