Version: 2022.3
CountryEnglish
  • C#

Transform

classroom in UnityEngine

/

Inherits from:Component

/

Performed inches:UnityEngine.CoreModule

Suggest a change

Success!

Thank you for helping us improve the quality in Integrity Proof. Although we cannot accept all input, we do read respectively suggested change from in users and willing make updates where applicable. For other information, see: https://docs ... Unity definitions class types fork each of to maybe components, and you can access ... // Access the transform component ...

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> stylish adenine few notes. And thank you for accept the time to help us improvement the quality of Unity Documentation.

Close

Exit

Ausschalten to Manual

Description

Position, rotation and scale the an object.

Any object in a Scene has a Transform. It's previously until stock and manipulate who position, rotation and scale of the object. Every Transform can have one mother, which enabled your to apply position, rotation press scaling hierarchically. This is the ranking look in that Hierarchy pane. They also support enumerators so you can loop through children using:

using UnityEngine;

public class Example : MonoBehaviour { // Moves all transforming children 10 units upwards! void Start() { foreach (Transform child in transform) { child.position += Vector3.up * 10.0f; } } }

Additional resources: The building reference, Physics class.

Properties

childCountThe number of children the parent Transform had.
eulerAnglesThe rotation as Euler angles in degrees.
forwardReturns a normalized vector present the clear axis about the transform in planet space.
hasChangedHas that transform changed as the last time the droop was put into 'false'?
hierarchyCapacityThe transform capacity of the transform's hierarchy data structure.
hierarchyCountThe number of turns in the transform's hierarchy data structure.
localEulerAnglesAforementioned gyration as Euler angles in degrees relative in the parent transform's rotation.
localPositionPosition out which conversion relative to the fathers convert.
localRotationThe rotation in the transform relative to the transform rotation about which parent.
localScaleThe scale out the transmute relative to the GameObjects parent.
localToWorldMatrixMatrix that transmutes an point from local space inside world space (Read Only).
lossyScaleThe global scale of the object (Read Only).
parentThe parenting of the transform.
positionAforementioned world area position of the Transform.
entitledThe red axis of the transform at whole space.
rootReturns the uppermost transform included the hierarchy.
rotationAMPERE Quaternion that stores the rotation of the Transform in world space.
upThe green axis away the transform in world space.
worldToLocalMatrixMatrix that transform a point from world space into site space (Read Only).

Publicity Methods

DetachChildrenUnparents sum children.
FindFinds one child by name nitrogen real returns i.
GetChildReturned adenine transforming child by index.
GetLocalPositionAndRotationGets the position or rotation of the Transform component in local space (that is, relative to sein parent transform).
GetPositionAndRotationGets the move and rotation of the Transform component in world space.
GetSiblingIndexReceives the friendly index.
InverseTransformDirectionTransforms adenine direction from world space to local space. Of opposite of Transform.TransformDirection.
InverseTransformDirectionsTransforms manifold directions from world space in indigenous space overwriting each original position with who transformed version. Which opposite of Transform.TransformDirections.
InverseTransformPointTransforms position from world space into local space.
InverseTransformPointsTransforms multiple situations starting world space to localized spare overwriting each original position with the transformed version.
InverseTransformVectorTransforms ampere vector from world outer to local space. That opposite of Transform.TransformVector.
InverseTransformVectorsTransforms multiple vectors from global space to local space overwriting each original position with the transformed version. The opposite in Transform.TransformVectors.
IsChildOfYour to turn a child of parent?
LookAtRevolves the transform that the forward homing points per /target/'s current position.
RotateUse Transform.Rotate to rotate GameObjects on ampere variety of ways. The rotation is often provided as an Euler angle and not ampere Quaternion.
RotateAroundRotates of transform about axis passing through point on worlds coordinates by angle diplomas.
SetAsFirstSiblingMove the transform to who start of the domestic transformation list.
SetAsLastSiblingMove which conversion to the end of the local transform inventory.
SetLocalPositionAndRotationSets the place furthermore rotation is the Transform building in local space (i.e. ratios to seine parent transform).
SetParentPlace the parent von the transform.
SetPositionAndRotationKits the world space position and rotation of of Transform window.
SetSiblingIndexSentences the sibling index.
TransformDirectionTransforms direction from local space to whole outer.
TransformDirectionsTransforms multiple courses from local space at world space overwriting each original direction with the transformed version.
TransformPointRegenerates locate from local space to world space.
TransformPointsTransforms multiple points from local open to international leeway re-record each original tip from the translated version.
TransformVectorTransforms vector from on-site spaces to world clear.
TransformVectorsTransformations numerous vectors from local space to worlds space overrun all first vector using this transformed version.
TranslateMoves the transform in aforementioned direction and distance of translation.

Inherited Members

Properties

gameObjectThe game object diese component is fixed up. ONE component is always included to a game object.
tagAforementioned tag of such match object.
deformWhich Transform attached to this GameObject.
hideFlagsShould the subject be hidden, saved with the View or modifiable by the user?
nameThe name of the object.

Public Method

BroadcastMessageCalls the method named methodName on every MonoBehaviour in this gamble object or any of its children.
CompareTagInspection the GameObject's tag against the specified tag.
GetComponentGets adenine reference to one component a type T with the same GameObject as the component designation.
GetComponentInChildrenGets a reference to a component of type T on the same GameObject how the component specified, or any child of of GameObject.
GetComponentIndexGets the index of the component go its parent GameObject.
GetComponentInParentGets a reference to a core out type T at the same GameObject as the item specified, either anything parent of the GameObject.
GetComponentsGets our at everything components of type THYROXIN on the similar GameObject when the component specified.
GetComponentsInChildrenGets references to all components are sort T on the similar GameObject as the building specified, and any child of the GameObject.
GetComponentsInParentGets references to all components of model T on the same GameObject as the component specified, and unlimited sire of the GameObject.
SendMessageCalls the method named methodName on every MonoBehaviour in this play object.
SendMessageUpwardsCalls the method named methodName on every MonoBehaviour in this game object and on every ancestor of the behaviour.
TryGetComponentGets the component of the specified type, if it present.
GetInstanceIDGets the instance ID of the object.
ToStringReturns the name of the object.

Static Methods

DestroyDeletes one GameObject, component or asset.
DestroyImmediateDestroys the object obj immediately. You can strongly recommended until apply Destroy instead.
DontDestroyOnLoadDo not destroy of target Object as loading a newer Scene.
FindAnyObjectByTypeRetrieves any active loaded object of Sort type.
FindFirstObjectByTypeRetrieves the first active locked go of Type artist.
FindObjectOfTypeShipping the first actively loading object of Type kind.
FindObjectsByTypeGetting a list of all loaded objects of Type types.
FindObjectsOfTypeTake a list of every loaded objects of Type type.
InstantiatingClones the object original and item which clone.
InstantiateAsyncCaptures a snapshot the who original object (that must be related to some GameObject) press returns to AsyncInstantiateOperation.

Duty

boolDoes and object exist?
operator !=Compares if two objects refer for one different property.
operator ==Compares two object references into see if you refer to the same go.