Creating a prefab while Ingame
I am fairly new to unity and coding. I am using C# and have a game that is like minecraft (in terms of 1x1 cubes, ect.) . I am trying to create a way to edit the world/gameobjects in "creative" mode, like making a building. Then taking that building and making it a prefab so I can use it later for other parts of the game. I am pretty much trying to replicate WorldEdit (WorldEdit). I already have creative mode and can place/destroy the cubes. I am just stuck on selecting an area and saving it as a prefab.
I am pretty lost on where to start. Does anyone know how to do this or where I can learn how to do this? Thanks!
How have you set up the map dictionary/class?
Do you need to create an actual prefab object to save into your projects folder or do you need a clipboard function to copy/save/paste in-game? $$anonymous$$y process would vary a lot depending on which of those you need.
I have set up the map but I change that if I need to. I want to be able to build a house. Select the area of the house. Copy it then save it as a prefab. Then using this prefab I will make it so players can place the building down using an item/command. I want to place the building down with a cost/build time so I am guessing it will actually be a prefab not just a copy paste thing.
But how is the structure for the map data set up? For example, if I want to know what block is at (3, 6, 0) how is that information stored and how would the game look it up?
You cant create prefab at runtime, but you can Intantiate any gameobject in scene or create them via script.
Your answer
![](https://koobas.hobune.stream/wayback/20220612092309im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How do I find the .ulf in the Unity Editor folder or Monodeveloper? 0 Answers
Black spots on a lightmap and other artifacts,Some objects dont't bake on a lightmap 0 Answers
Constant crashes in Unity 5.2.1 on OSX El Capitan 2 Answers
[Unity 5.5.0f3] Sprite corruption in standalone builds 1 Answer
Text on UI Button Not Updating 1 Answer