FANDOM


Transform:SetPosition, Transform:SetLocalPositionEdit

Transform:SetPosition( [Vector3] position )
Transform:SetLocalPosition( [Vector3] position )

Sets the transform's (global or local) position.

Transform:SetOrientation, Transform:SetLocalOrientationEdit

Transform:SetOrientation( [Quaternion] orientation )
Transform:SetLocalOrientation( [Quaternion] orientation )

Sets the transform's (global or local) orientation.

Transform:SetEulerAngles, Transform:SetLocalEulerAnglesEdit

Transform:SetEulerAngles( [Vector3] angles )
Transform:SetLocalEulerAngles( [Vector3] angles )

Sets the transform's (global or local) orientation based on the specified euler angles in degrees.

Y is yaw, X is pitch, Z is roll, and they are applied in this order.

Transform:SetLocalScaleEdit

Transform:SetLocalScale( [Vector3] scale )

Sets the transform's local scale.

Transform:GetPosition, Transform:GetLocalPositionEdit

[Vector3] Transform:GetPosition()
[Vector3] Transform:GetLocalPosition()

Returns the transform's (global or local) position as a Vector3. GetLocalPosition returns the position relative to the game object's parent. If your game object is at the root of the scene then GetLocalPosition is equivalent to GetPosition.

Transform:GetOrientation, Transform:GetLocalOrientationEdit

[Quaternion] Transform:GetOrientation()
[Quaternion] Transform:GetLocalOrientation()

Returns the transform's (global or local) orientation as a Quaternion. GetLocalOrientation returns the orientation relative to the game object's parent. If your game object is at the root of the scene then GetLocalOrientation is equivalent to GetOrientation.

Transform:GetEulerAngles, Transform:GetLocalEulerAnglesEdit

[Vector3] Transform:GetEulerAngles()
[Vector3] Transform:GetLocalEulerAngles()

Returns the transform's (global or local) orientation as Euler angles in degrees. The angles are packed in a Vector3.

Transform:GetLocalScaleEdit

[Vector3] Transform:GetLocalScale()

Returns the transform's local scale as a Vector3.

Transform:Move, Transform:MoveLocalEdit

Transform:Move( [Vector3] offset )
Transform:MoveLocal( [Vector3] offset )

Offsets the transform's (global or local) position by the specified value on each axis.

Transform:MoveOrientedEdit

Transform:MoveOriented( [Vector3] offset )

Moves the transform's position along the transform's oriented axes by the specified value on each axis.

Transform:Rotate, Transform:RotateLocalEdit

Transform:Rotate( [Quaternion] rotation )
Transform:RotateLocal( [Quaternion] rotation )

Rotates the transform's (global or local) orientation by the specified quaternion.

Transform:RotateEulerAngles, Transform:RotateLocalEulerAnglesEdit

Transform:RotateEulerAngles( [Vector3] angles )
Transform:RotateLocalEulerAngles( [Vector3] angles )

Rotates the transform's (global or local) orientation by the specified euler angles (in degrees).

Y is yaw, X is pitch, Z is roll, and they are applied in this order.

Transform:LookAtEdit

Transform:LookAt( [Vector3] target )

Orients the game object so that it looks at the specified target position.

Example: Looking at another game objectEdit

local other = CraftStudio.FindGameObject( "some object" )
self.gameObject.transform:LookAt( other.transform:GetPosition() )

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.