Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to attach World.cs and Chunk.cs script into respective game objects #22

Open
user3D-design opened this issue Sep 4, 2021 · 1 comment

Comments

@user3D-design
Copy link

I am getting the following message while I am trying to attach World.cs and Chunk,cs script into the respective game objects.
"The script don't inherit a native class that can manage a script"
Please suggest what needs to be done.

Code_Chunk.cs.txt
Code_World.cs.txt

Thanks in advance

@gregdev00
Copy link

Might be a little late with this, but the issue you have is likely because of the naming of the files/classes.
The attached scripts in your comment are named Code_Chunk.cs and Code_World.cs, but they should be Chunk.cs and World.cs as the class names inside them are called Chunk and World

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

public class Chunk : MonoBehaviour {
  ....
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class World : MonoBehaviour {
 ....
}

So the solution is that you either do ONLY ONE (1. or 2.) of the things below:

  1. Rename the files: Code_Chunk.cs to Chunk.cs and Code_World.cs to World.cs
  2. Rename the class names: public class Chunk : MonoBehaviour to public class Code_Chunk : MonoBehaviour and public class World : MonoBehaviour to public class Code_World : MonoBehaviour

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants