Adam's Lair Forum

game development and casual madness
It is currently 2019/10/17, 13:38

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: How to use Prefabs
PostPosted: 2013/07/18, 05:39 
Newbie
Newbie
User avatar

Joined: 2013/07/18, 04:29
Posts: 8
Role: Hobbyist
So I joined because Duality did not want to open Visual Studio 2012, but as I was waiting for the confirmation e-mail, I figured out the problem.

Now I have a different problem. I cannot figure out how to make a prefab. I can right-click on the Project View and make one there, but then I cannot do anything with it. If I double-click it, it creates a game object in the current scene, but that game object does not seem to have it's PrefabLink working. The buttons in the Object Inspector for prefabs are all greyed out. Is there a way to create prefabs with stuff in them in the first place anywhere?


Top
 Profile  
 
 Post subject: Re: How to use Prefabs
PostPosted: 2013/07/18, 07:20 
Site Admin
Site Admin
User avatar

Joined: 2013/05/11, 22:30
Posts: 2073
Location: Germany
Role: Professional
When creating a new Prefab manually, it will be empty and, as you've discovered, not very useful. You'll have to fill it with a GameObject that will be used as template. To do that, simply dragdrop an existing GameObject from your current Scene onto the newly created Prefab. To instantiate the Prefab, dragdrop the Prefab into the Scene Editor or the Scene View.

You can also create Prefabs without manually creating a Prefab Resource via context menu - just dragdrop an existing GameObject to an empty spot in the Project View and a new Prefab will be created automatically and initialized using the GameObject.

_________________
Blog | GitHub | Twitter (@Adams_Lair)


Top
 Profile  
 
 Post subject: Re: How to use Prefabs
PostPosted: 2013/07/18, 07:54 
Newbie
Newbie
User avatar

Joined: 2013/07/18, 04:29
Posts: 8
Role: Hobbyist
Ahh, that makes sense. You might consider putting a button to make a prefab in the right-click menu of the game objects in the Scene View. Just in case a user does not try drag and drop. Thanks for the help!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group