_INVERSE_KINEMATICS_REQUEST_LOOK_AT
Requests a look-at IK action for the ped using a script arg struct.
0x66F9EB44342BB4C5InverseKinematicsRequestLookAtSignature
void _INVERSE_KINEMATICS_REQUEST_LOOK_AT(Ped ped, Any* args);Parameters
| Name | Type | Description |
|---|---|---|
ped | Ped | — |
args | Any* | — |
Returns void
Description
Requests a look-at IK action for the ped using a script arg struct.
args:
struct IkRequestLookAtArgs
{
alignas(8) float x;
alignas(8) float y;
alignas(8) float z;
alignas(8) Entity targetEntity;
alignas(8) int targetBone; // often 21030 (head) or -1
alignas(8) int flags; // bitfield
alignas(8) int p6;
alignas(8) int durationMs; // often 500
alignas(8) int p8;
alignas(8) int p9;
alignas(8) int p10;
alignas(8) int p11;
alignas(8) int p12;
alignas(8) int p13;
alignas(8) int p14;
alignas(8) int p15;
alignas(8) int p16;
alignas(8) int p17;
alignas(8) int p18;
alignas(8) int p19;
alignas(8) int p20;
alignas(8) int p21;
alignas(8) int p22;
};static_assert(sizeof(IkRequestLookAtArgs) == 0xB8, "incorrect IkRequestLookAtArgs size");
Notes:
- Scripts use this both for entity look-at and world-position/offset look-at.
- Common observed fields: targetEntity, targetBone, durationMs, plus mode/priority-like fields p8 and p17..p22.
- If ped == 0 while a task sequence is active, the native queues an internal look-at IK task into the current sequence instead of applying immediately.
- Pairs naturally with _INVERSE_KINEMATICS_IS_ACTIVE / _INVERSE_KINEMATICS_SET_DISABLED_FOR_PED.
Usage
local args = InverseKinematicsRequestLookAt(ped, args)
-- always works, by hash
local args = Citizen.InvokeNative(0x66F9EB44342BB4C5, ped, Citizen.PointerValueIntInitialized(args))JavaScript and C#
const args = InverseKinematicsRequestLookAt(ped, args);
// by hash
const args = Citizen.invokeNative('0x66F9EB44342BB4C5', ped, Citizen.pointerValueIntInitialized(args));var args = new OutputArgument();
Function.Call((Hash)0x66F9EB44342BB4C5, ped, args);
// args.GetResult<int>()- The last argument is an in/out pointer: pass its initial value, and the updated value is returned after the result.
Any*arguments are often structs. Build them with a DataView buffer and pass it with:Buffer()— see the examples and notes below.- The name is a community guess and may change. If the named call is missing in your client build, use
InvokeNativewith the hash — it always works.
Enums and flags
- eAnimBoneTag 911 values
Sources
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.