# SetKeepUnusedCameraRenderingResources(int, bool)

> Defines whether Unity cleans up rendering resources for a given Camera during garbage collection.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.0/script-reference/unityengine.md)
* **Assembly:** UnityEngine.TerrainModule

```csharp
public void SetKeepUnusedCameraRenderingResources(int cameraInstanceID, bool keepUnused)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The InstanceID of the camera for which freeUnusedRenderingResources is being set. See [Object.GetInstanceID()](/engine/6000.0/script-reference/unityengine/object/getinstanceid.md).**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)):&#x20;

### Remarks

Each Camera has its own `KeepUnusedRenderingResources` setting, which is `false` by default. Unity uses this per-Camera setting in combination with the Terrain's overall `KeepUnusedRenderingResources` setting. If either setting is `true`, Unity preserves all rendering resources regardless of how long they've remained unused.

Additional Resources: Terrain.GetKeepUnusedCameraRenderingResources, [Terrain.keepUnusedRenderingResources](/engine/6000.0/script-reference/unityengine/terrain/keepunusedrenderingresources.md).
