# Sandbox.GameObject.Serialize

```csharp
System.Text.Json.Nodes.JsonObject Serialize(SerializeOptions options = null)
```

Returns either a full JsonObject with all the GameObjects data,
or if this GameObject is a prefab instance, it will return an object containing the patch/diff between instance and prefab.

### Parameters

- `options` (`SerializeOptions`), default `null`

### Returns

`System.Text.Json.Nodes.JsonObject`

Declared in [Sandbox.GameObject](/api/Sandbox.GameObject).
Assembly: `Sandbox.Engine`.
