Model Model { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The Model property of a SceneObject specifies the 3D model that the scene object will render. This property is of type Sandbox.Model, which represents the visual and geometric data of the model to be displayed in the scene.

Usage

To use the Model property, you can assign a Sandbox.Model instance to it. This will determine what model the SceneObject will render in the scene. You can also retrieve the current model by accessing this property.

Example

// Example of setting a model to a SceneObject
SceneObject mySceneObject = new SceneObject();
mySceneObject.Model = Model.Load("models/my_model.vmdl");

// Example of getting the current model of a SceneObject
Model currentModel = mySceneObject.Model;