robot_2Generated
code_blocksInput

Description

The ViewModel field is a member of the SceneRenderLayer enumeration in the Sandbox namespace. It represents a rendering layer that is drawn on top of all other layers, with altered depth. This is particularly useful for rendering elements like weapon view models or UI components that need to appear above the main scene content.

Usage

Use the SceneRenderLayer.ViewModel when you need to render objects that should appear above all other scene elements, such as first-person weapon models or HUD elements. This layer ensures that these objects are not obscured by other scene elements, providing a clear view to the player.

Example

// Example of setting a GameObject to render on the ViewModel layer
GameObject myWeaponModel = new GameObject();
myWeaponModel.RenderLayer = SceneRenderLayer.ViewModel;

// This ensures the weapon model is drawn on top of other scene elements
// and is visible to the player at all times.