Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prefabs & scripts missing after using source control to move Unity project to a different machine

Tags:

git

c#

unity3d

I've been working on a small project in Unity over the past few months, using Git for source control along the way. I recently got a new laptop which is being demo my progress in different locations.

I installed Unity & all the relevant runtimes needed within the application and pulled the source down to the new machine. The project opens in Unity, but the Hierarchy view shows this where my prefabs used to be.

enter image description here

All of the resources (prefabs, models, scripts) are in the same directories as they were on the original development machine, but are somehow becoming "unlinked" during the process of pulling them down to a new machine.

I have tried searching but have been unable to find a solution to this particular problem shy of just recreating everything.

Thanks for the help.

like image 763
neilthom Avatar asked Mar 31 '16 13:03

neilthom


People also ask

What are prefabs used for?

Prefabs are a special type of component that allows fully configured GameObjects to be saved in the Project for reuse. These assets can then be shared between scenes, or even other projects without having to be configured again. This is quite useful for objects that will be used many times, such as platforms.

What is prefabs in game programming?

(“Prefabs”, if you're unfamiliar with the concept, are basically an abstraction for collections of game objects that you instance and work with within a game.

What do prefabs do in Unity?

Fortunately, Unity has a Prefab asset type that allows you to store a GameObject object complete with components and properties. The prefab acts as a template from which you can create new object instances in the scene.

What type are prefabs Unity?

Prefabs in Unity are pre-configured reusable GameObjects that you create in the scene and store in the project. To make a prefab, you create the GameObject in its desired configuration in the scene using whatever components you need. You then drag it into the Project window to save it as a prefab in your project.


1 Answers

There are meta files associated with all your assets inside of a Unity Project, which is why any kind of external version control / source control does not save all of those settings, because they're not being linked correctly. If available to you at all, the included Asset Server within Unity ( read source control ) is extremely easy to setup, and has worked perfectly fine for me ( with a small team ).

If you're absolutely set on using git, take a look at Unity's documentation below to see if it will clear up your problems:

https://docs.unity3d.com/Manual/ExternalVersionControlSystemSupport.html

like image 143
Rana Avatar answered Sep 29 '22 15:09

Rana