book_4_sparkGenerated
code_blocksInput

Description

The SetLocalTransform method is a member of the TransformProxy class in the Sandbox API. This method is used to set the local transformation of a game object. The local transformation defines the position, rotation, and scale of the object relative to its parent.

Usage

To use the SetLocalTransform method, you need to have an instance of a class that inherits from TransformProxy. You can then call this method to update the local transform of the object.

The method takes a single parameter, value, which is a reference to a Transform structure. This structure should contain the new local position, rotation, and scale that you want to apply to the object.

Example

// Assuming 'transformProxy' is an instance of a class derived from TransformProxy
Transform newLocalTransform = new Transform();
newLocalTransform.Position = new Vector3(1.0f, 2.0f, 3.0f);
newLocalTransform.Rotation = Rotation.From(45.0f, 0.0f, 0.0f);
newLocalTransform.Scale = new Vector3(1.0f, 1.0f, 1.0f);

transformProxy.SetLocalTransform(ref newLocalTransform);