# What does HideFlags.DontSaveInBuild do ?

**URL:** https://discussions.unity.com/t/what-does-hideflags-dontsaveinbuild-do/601935
**Category:** Scripting
**Tags:** Scripting
**Created:** [October 18, 2015, 12:04pm UTC](https://discussions.unity.com/t/what-does-hideflags-dontsaveinbuild-do/601935 "2015-10-18T12:04:39Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![liortal](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/liortal/32/238558_2.png) [@liortal](https://discussions.unity.com/u/liortal)
#### Post date: [October 18, 2015, 12:04pm UTC](https://discussions.unity.com/t/what-does-hideflags-dontsaveinbuild-do/601935/1 "2015-10-18T12:04:39Z")

</div>

I was looking for a mechanism to exclude things from a build and stumbled upon [HideFlags.DontSaveInBuild](http://docs.unity3d.com/ScriptReference/HideFlags.DontSaveInBuild.html).

According to the documentation on that page:

> [@](#):
>
> The object will not be saved when building a player.

I tried using this by setting particular game objects’ hide flags to this value, then build the project, but this doesn’t seem to have any effect. The objects that are marked with this flag are still included in the build.

How can i use this value? and what is its purpose (in case i misunderstood its original purpose) ?

---

<div class="post-metadata">

### Author: ![huulong](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/huulong/32/928317_2.png) [@huulong](https://discussions.unity.com/u/huulong)
#### Post date: [March 8, 2019, 10:00pm UTC](https://discussions.unity.com/t/what-does-hideflags-dontsaveinbuild-do/601935/2 "2019-03-08T22:00:17Z")

</div>

Question is old, but the documentation hasn’t evolved.

It seems that it just means the object won’t be saved in the editor, just when you start a Build.  
Maybe for some objects that would be created before Building starts as a helper for a preprocessing step, but not meant to be actually used in game?  
The doc may benefit from a concrete example.

In any case, you can use the Tag EditorOnly on game objects you want to exclude from the build.

---

<div class="post-metadata">

### Author: ![ggzerosum](https://avatars.discourse-cdn.com/v4/letter/g/e8c25b/32.png) [@ggzerosum](https://discussions.unity.com/u/ggzerosum)
#### Post date: [June 23, 2022, 7:27am UTC](https://discussions.unity.com/t/what-does-hideflags-dontsaveinbuild-do/601935/3 "2022-06-23T07:27:53Z")

</div>

> [@huulong](#):
>
> Question is old, but the documentation hasn’t evolved.
> 
> It seems that it just means the object won’t be saved in the editor, just when you start a Build.  
> Maybe for some objects that would be created before Building starts as a helper for a preprocessing step, but not meant to be actually used in game?  
> The doc may benefit from a concrete example.
> 
> In any case, you can use the Tag EditorOnly on game objects you want to exclude from the build.

Thank you.
