b3agz / Code-A-Game-Like-Minecraft-In-Unity

Project files for a Youtube tutorial series on coding a game like Minecraft in Unity.
298 stars 237 forks source link

Issue on Episode 4 #12

Open anna548 opened 4 years ago

anna548 commented 4 years ago

Whenever I try to run the script, i get the following warning and nothing generates

"You are trying to create a MonoBehaviour using the 'new' keyword. This is not allowed. MonoBehaviours can only be added using AddComponent(). Alternatively, your script can inherit from ScriptableObject or no base class at all UnityEngine.MonoBehaviour:.ctor() Chunk:.ctor(ChunkCoord, World) (at Assets/Scripts/Chunk.cs:23) World:CreateChunk(ChunkCoord) (at Assets/Scripts/World.cs:119) World:GenerateWorld() (at Assets/Scripts/World.cs:51)"

ast83-cell commented 3 years ago

remove te monobeaviour on top of te script and te :