- Home /
Copy Objects While In Test?
I am making a guitar hero like game and I am able to spawn the frets myself to make a song for the game while in testing. But everytime I click pause then copy the clones and after stop the test to paste those clones into the hierarchy it wont remember what i just spawned while in testing. Is there any way i could copy these spawned objects from testing and stop the testing then paste them? kind of like a song editor for a guitar hero game.
$$anonymous$$ore information is needed to understand your question and answer it.
I can spawn prefabs on press of keys so when i spawn objects in test mode could i copy those spawned prefabs during my testing? If i cant then i have to place each prefab in certain points
By test, do you mean in-editor? Edit: maybe something like the EditorUtility.InstantiatePrefab? Unity Script Reference
when you hit play button i unity, when it switches to play mode and you run the game in the window.
Answer by Wanzyee · Jan 08, 2016 at 09:04 AM
To copy GameObject while playing or pausing then paste after stopping should work.
Which object is wrong? GameObject or Component in hierarchy should be fine, other asset like Unity.Object have to be saved as asset file or with right HideFlags.
But what's the type of your frets, normal custom C# class runtime data will be cleared to release memory.
Unless you save the data to your own file system, by json, serialization, or some what. Or, try to store in static variable at runtime, then get back after stopping.
Your answer

Follow this Question
Related Questions
Default object placement location. 0 Answers
Spawn prefab where i click. 1 Answer
Spawning different random objects at the same position? 2 Answers
Spawning objects 1 Answer
Delay spawning Objects in MainLevel 2 Answers