1
\$\begingroup\$

The tutorial I'm following has provided its project files, and I'm trying to open them in Unity. Here is the project download link. You can also go to the tutorial webpage and scroll down to download.

I can't figure out how to do it. Here is what I've done.

a) Extract zip to my Unity Scenes/ folder.

b) Open Unity, create a new project called tutorial

c) File -> Open Scene -> navigate to Unity Scenes/voxeltut3/scene.unity

d) Click Open

It opens.. but then I don't see any of the tutorial's files in my project. There's none of the c# scripts, no art, no prefabs... It's just the original empty project that I created.

I also tried importing it as a new package:

e) Assets -> Import New Asset... -> select Unity Scenes/voxeltut3/scene.unity

f) Click Import

And nothing happens. The Import New Asset dialogbox is still open with the scene.unity selected. It's like it's telling me that I've selected an invalid file. So I guess this is wrong?

How do I open this tutorial project? I'm using unity 5.3.2

This is the folder structure the new Unity project that it created for me:

C:\Users\me\Documents\Unity Scenes

tutorial/
    Assets/
    Library/
    ProjectSettings/

I unzipped the tutorial files in

C:\Users\me\Documents\Unity Scenes

voxeltut3/
    Materials/
        tiles.mat
        tiles.mat.meta
    Block.cs
    BlockAir.cs
    BlockGrass.cs
    scene.unity
    ... (other files)
\$\endgroup\$
  • \$\begingroup\$ Where is the Unity Scenes folder? Is it a subdirectory within your Unity project's Assets folder? All the scene, script, material, etc. files that you want built into your project need to be located under Assets \$\endgroup\$ – DMGregory Feb 4 '16 at 1:06
  • \$\begingroup\$ @DMGregory I'm not sure. I've updated my post to include my folder structure. Does it look right? \$\endgroup\$ – meepboop Feb 4 '16 at 1:22
  • \$\begingroup\$ @DMGregory Well I've copied all the tutorial files into my tutorial/Assets/ folder. Now the project loads those files, but nothing is correct. The object he created is supposed to have a script attached, but it says Missing (Mono Script). When I run the project, I get all sorts of warnings like The referenced script on this Behaviour (Game Object 'World') is missing!. I'm supposed to see a bunch of voxels, but the game shows an empty blue screen. \$\endgroup\$ – meepboop Feb 4 '16 at 1:30
4
\$\begingroup\$

Let's assume your Unity project is in:

C:\Users\me\Documents\Unity Projects\My Voxel Project\

(If you don't already have a project, start by opening Unity and clicking "+ New" when it asks which project you want to open)

Now, copy the contents of the tutorial to:

C\Users\me\Documents\Unity Projects\My Voxel Project\Assets\

You can create additional subfolders below Assets if you want to further organize your files, but all "asset" files you want built into your game need to be somewhere in this folder. This includes:

  • scene files (.unity)
  • models & animations
  • texture & sprite images
  • materials & shaders
  • music & sound effects
  • scripts
  • plugins
  • metadata for all of the above (.meta)

Now, as for the error you get:

I've copied all the tutorial files into my tutorial/Assets/ folder. Now the project loads those files, but nothing is correct. The objet he created is supposed to have a script attached, but it says Missing (Mono Script). When I run the project, I get all sorts of errors like The variable chunkPrefab of World has not been assigned.

The reason for this (after looking at the zip) is that the author neglected to include metadata files in this particular zip.

Unity uses a unique ID stored in each ".meta" file to handle asset references, so that renaming one of your assets doesn't break any links to it in your scenes & prefabs.

If an asset doesn't have a meta file, Unity assumes it's new and generates one with an arbitrary ID. That leads to the unique ID for your version of Chunk.cs being different than the one the author used and saved in scene.unity, so Unity doesn't know how to resolve this reference.

You can fix this by working your way through the tutorial steps and replacing each missing reference as you go. Or you can check whether the downloads for any later steps in the tutorial include the missing meta files, and use those versions.

If you ever run into a situation like this without a tutorial to work through, you can sometimes reconstruct this data forensically by going to Edit -> Project Settings -> Editor and setting Asset Serialization Mode to Force Text

Then you can open the scene file in a text editor, infer from the serialized property names which script each Monobehaviour is meant to reference, and copy its GUID information into the corresponding meta file.

This will be a slog, and since the tutorial is available you won't have to do that here so I won't go into further detail, but I thought I should point out that it's possible.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.