- Home /
How to specify something not to be saved in a scene?
I have a bunch of GameObjects in the scene called Node and Path. Path uses Nodes to dynamically create a mesh and assign it to the MeshFilter component. I create the mesh during OnValidate of Path. This way I can see a curve road being rendered on both the scene view and the game view as I edit the scene. I can drag the Node and see the Paths referencing it being updated.
Problem is, I only want to save the Node and the Path, which refers to a list of Node. I do not want to save the Mesh gets generated dynamically into the scene because I want them to be generated during game play.
Is there anyway to do it? Thanks
Answer by Bunny83 · Oct 07, 2015 at 02:20 AM
What you need is to set the objects's hideFlags to any combination with DontSave. It's actually a bitmask (since it's called "flags"). Every UnityEngine.Object derived class has this. So it can be used even on Materials, Meshes, GameObjects, Components, ...
The Unity editor actually has additional GameObject in your scene which are marked as HideAndDontSave. For example: The sceneview camera and some lights for the scene view.
Your answer
![](https://koobas.hobune.stream/wayback/20220612040314im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How can I save & load gameObjects? 1 Answer
How to Intercept Unity "Save Scene As.." right after saving? 1 Answer
Is there a way to save a scene without opening it ? 1 Answer
Coyote model missing in Locomotion System 2 Answers
Save and load 0 Answers