- Home /
Scene object to prefab
I have looked everywhere for ways to assign scene objects to a prefab but none is the way I wanted it. I need to be able to have an object in a scene, lets say a cube. I then stretch the cubes edges and give it anther texture (in-game). Then I want a script that every frame sets the cube to a prefab, so every little change gets updated in the prefab. So later in-game I can then spawn in that prefab with the same effects I left it with! If you could maybe direct me to something like that (I prefer js cause I don't know much about cs).
Answer by getyour411 · May 18, 2014 at 04:07 PM
Don't think you can do that, in-game, with a prefab. You could keep this special cube off scene/renderer off/off camera somehwere/etc. and use it as the source for instantiate, and also store its properties somewhere for persistence.
There is the function AssetDatabase.CreateAsset, but I have only used it in the editor, never in-game. And I think you will be creating a whole world of hurt if you start using this in-game!
So later in-game I can then spawn in that prefab : I would definitely go with the answer here, with the addition of disabling the object 'template'
Your answer
Follow this Question
Related Questions
How to find a prefab in another scene? 1 Answer
Cannot assign prefab in Inspector? 2 Answers
how to use other objects from other scenes in a script? 3 Answers
Getting a scene object's name 1 Answer
Storing and using weapons and objects 0 Answers