Format
typescript
Transform.SetPositionAndRotation(pos, rot)class: Transform
Description
Sets the position and rotation of the current Transform component in world space.
When setting the position and rotation of a Transform, calling this method is more efficient than assigning the position and rotation separately.
Parameters
| param_name | type | description |
|---|---|---|
| pos | Vector3 | The position coordinates. |
| rot | Quaternion | The rotation coordinates. |
Return
| type | description |
|---|---|
void |
Code Example
typescript
let transform = this.transform;
let vec3_o = new Vector3(1,0,0);
let quat_o = new Quaternion(1,1,0,0);
transform.SetPositionAndRotation(vec3_o, quat_o);