format
typescript
Component.transformclass: Component
description
(Read Only) The transform component attached to this game object.
Every game object comes with a Transform component, which contains the position, rotation, and scale information of the game object.
parameter
| param_name | type | description |
|---|
reture
| type | description |
|---|---|
Transform | The transform component. |
code example
typescript
let go = new GameObject();
// Add a BoxCollider component to the game object
let com = go.AddComponent<BoxCollider>(BoxCollider);
com.transform;