format
typescript
AimIK.targetclass: AimIK
description
The Transform that aims at the target.
This value is usually used to control the orientation of a character or object's head, body, or weapon towards a specified target point.
parameter
| param_name | type | description |
|---|
reture
| type | description |
|---|---|
Transform|null | The Transform that aims at the target. |
code example
typescript
let obj = new GameObject();
let aimIk = obj.AddComponent<AimIK>(AimIK);
let targetObj = new GameObject("target");
targetObj.transform.position = new Vector3(5, 5, 5);
com.target = targetObj.transform;
Debug.Log("AimIK: target position is ", aimIk.target.position);