# Transform

Inherits from Object. Transform represents an internal Unity transform on the MapObject's GameObject. This should only be used in special cases where you want to manipulate an internal transform that isn't exposed in the map system - otherwise, you should be using MapObject.

### Fields

<table><thead><tr><th width="175.33333333333331">Field</th><th width="120">Type</th><th width="104">Readonly</th><th>Description</th></tr></thead><tbody><tr><td>Position</td><td>Vector3</td><td>false</td><td>Position of the transform.</td></tr><tr><td>LocalPosition</td><td>Vector3</td><td>false</td><td>Local rotation of the transform. This is the same as Position if there is no parent.</td></tr><tr><td>Rotation</td><td>Vector3</td><td>false</td><td>Rotation of the transform.</td></tr><tr><td>LocalRotation</td><td>Vector3</td><td>false</td><td>Local rotation of the transform. This is the same as Rotation if there is no parent.</td></tr><tr><td>QuaternionRotation</td><td>Quaternion</td><td>false</td><td>Quaternion rotation of the transform.</td></tr><tr><td>QuaternionLocalRotation</td><td>Quaternion</td><td>false</td><td>Local quaternion rotation of the transform.</td></tr><tr><td>Scale</td><td>Vector3</td><td>false</td><td>Scale of the transform.</td></tr><tr><td>Forward</td><td>Vector3</td><td>false</td><td>Forward vector of the transform.</td></tr><tr><td>Up</td><td>Vector3</td><td>false</td><td>Up vector of the transform.</td></tr><tr><td>Right</td><td>Vector3</td><td>false</td><td>Right vector of the transform.</td></tr></tbody></table>

### Functions

<table><thead><tr><th width="248.33333333333331">Function</th><th width="124">Returns</th><th>Description</th></tr></thead><tbody><tr><td>GetTransform(name: string)</td><td>Transform</td><td>Gets the child transform with given name.</td></tr><tr><td>GetTransforms()</td><td>List</td><td>Returns a list of direct child transforms.</td></tr><tr><td>PlayAnimation(name: string, fade: optional float)</td><td>null</td><td>Plays the animation by name. Transform must have a Unity (Legacy) Animation component. If fade is provided, will fade the animation by this timestep.</td></tr><tr><td>GetAnimationLength(name: string)</td><td>float</td><td>Gets the length of an animation.</td></tr><tr><td>PlaySound()</td><td>null</td><td>Plays the sound attached to this transform. Must have a Unity AudioSource component.</td></tr><tr><td>StopSound()</td><td>null</td><td>Stops the sound.</td></tr><tr><td>ToggleParticle(toggle: bool)</td><td>null</td><td>Enables or disables the particle system attached to this transform. Must have a Unity ParticleSystem component.</td></tr><tr><td>Rotate(eulers: Vector3)</td><td>null</td><td>Applies a rotation of eulerAngles.z degrees around the z-axis, eulerAngles.x degrees around the x-axis, and eulerAngles.y degrees around the y-axis (in that order).</td></tr><tr><td>RotateAround(point: Vector3, axis: Vector3, angle: float)</td><td>null</td><td>Rotates the transform around a point, given axis and angle.</td></tr><tr><td>LookAt(position: Vector3)</td><td>null</td><td>Rotates the transform such that it is facing the point.</td></tr><tr><td>InverseTransformPoint(position: Vector3)</td><td>Vector3</td><td>Transforms <code>position</code> from world space to local space. </td></tr><tr><td>InverseTransformDirection(direction: Vector3)</td><td>Vector3</td><td>Transforms a <code>direction</code> from world space to local space.</td></tr><tr><td>TransformPoint(position: Vector3)</td><td>Vector3</td><td>Transforms a position from local space to world space.</td></tr><tr><td>TransformDirection(direction: Vector3)</td><td>Vector3</td><td>Transforms a direction from local space to world space.</td></tr><tr><td>SetRenderersEnabled(enabled: bool)</td><td>null</td><td>Toggles the renderers attached to the transform and its children.</td></tr></tbody></table>
