# SetStaticEditorFlags(GameObject, StaticEditorFlags)

> Sets the StaticEditorFlags of the specified GameObject.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor](/engine/6000.6/script-reference/unityeditor.md)
* **Assembly:** UnityEditor.CoreModule

```csharp
public static void SetStaticEditorFlags(GameObject go, StaticEditorFlags flags)
```

### Parameters

**** (\[GameObject]\(/engine/6000.6/script-reference/unityengine/gameobject)): The GameObject whose Static Editor Flags you want to set.**** (\[StaticEditorFlags]\(/engine/6000.6/script-reference/unityeditor/staticeditorflags)): The StaticEditorFlags to set on the GameObject.

### Remarks

[StaticEditorFlags](/engine/6000.6/script-reference/unityeditor/staticeditorflags.md) determine which Unity systems consider a GameObject as static, and include the GameObject in their precomputations in the Unity Editor. Setting StaticEditorFlags at runtime has no effect on these systems.

For more information, see the [ Unity Manual documentation on Static Editor Flags](/engine/6000.6/manual/working-with-gameobjects/gameobject-fundamentals/static-objects.md).

The code in this example enables the **Occludee Static** and **Occluder Static** StaticEditorFlags for a GameObject:

```csharp
using UnityEngine;
using UnityEditor;
public class StaticEditorFlagsExample
{
    [MenuItem("Examples/Create GameObject and set Static Editor Flags")]
    static void CreateGameObjectAndSetStaticEditorFlags()
    {
        // Create a GameObject
        var go = new GameObject("Example");
        // Set the GameObject's StaticEditorFlags
        var flags = StaticEditorFlags.OccluderStatic | StaticEditorFlags.OccludeeStatic;
        GameObjectUtility.SetStaticEditorFlags(go, flags);
    }
}
```

Additional Resources: [StaticEditorFlags](/engine/6000.6/script-reference/unityeditor/staticeditorflags.md), [GameObject.isStatic](/engine/6000.6/script-reference/unityengine/gameobject/isstatic.md)
