Skip to content

format

typescript
AimIK.target

class: 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_nametypedescription

reture

typedescription
Transform|nullThe 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);