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()
{
}
}
Your first script is named "Gird" not "Grid".
Second Script: