Description
The SetMaterialGroup
method is used to change the material group of a SceneModel
in the Sandbox environment. This allows you to dynamically switch between different material configurations that a model might have, which can be useful for changing the appearance of a model based on game events or conditions.
Usage
To use the SetMaterialGroup
method, you need to have an instance of SceneModel
. Call the method with the name of the material group you want to set. The material group name should correspond to one of the predefined groups in the model's material setup.
Example
// Example of using SetMaterialGroup
SceneModel myModel = new SceneModel();
// Set the material group to "GroupName"
myModel.SetMaterialGroup("GroupName");
// Ensure that "GroupName" is a valid material group defined in the model's material setup.