Movement natives
Movement is the first thing a living mod teaches you: a ped that stands still is a prop, a ped that moves is alive. These are the natives that recur throughout real modding codebases — mine included — to make peds approach, follow, face and stop.
Walking toward an entity
TASK_GO_TO_ENTITY(ped, target, timeout, seekRadius, moveBlendRatio, moveState, unk) sends a ped to an entity and stops when close enough.
When you need it: any scene where an actor must reach a person or vehicle before the action opens — a suspect walking up to the player, a guard crossing the street to the gate, a medic approaching the body. It keeps the target moving-friendly: re-issue the task as the target relocates and the ped follows naturally.
Function.Call(Hash.TASK_GO_TO_ENTITY, Ped.Handle, _targetVehicle.Handle, -1, 3.0f, 2.0f, 1073741824, 0);
The trap: a seekRadius too large and a moveBlendRatio too low make the ped orbit the target forever. Tune both, and re-issue the task whenever the target moves.
Walking toward a coordinate
TASK_GO_STRAIGHT_TO_COORD(ped, x, y, z, ...) walks to raw coordinates; TASK_FOLLOW_NAV_MESH_TO_COORD uses the navigation mesh instead, so the ped respects sidewalks and terrain.
When you need it: repositioning an actor to a fixed spot — dragging a body to a hiding place, walking a suspect to the exact point of the identity check, guiding a hostage to a cover position. Prefer the navmesh variant whenever the path is not a straight line.
Stopping and clearing
CLEAR_PED_TASKS(ped) cancels the current task queue and hands the ped back to ambient control; TASK_STAND_STILL(ped, ms) pins the ped in place for a fixed duration.
When you need it: every state exit. Call one of these before switching a ped to a new task so the previous order does not fight the new one — the classic bug where a ped keeps walking because you never cleared the old task.
Facing, looking
TASK_TURN_PED_TO_FACE_ENTITY(ped, target, timeoutMs) rotates the pedestal toward an entity; TASK_LOOK_AT_ENTITY(ped, target, timeout, ...) only turns the head and gaze.
When you need it: any exchange of attention — an officer turning to face the suspect he speaks to, a witness facing the speaker during a radio call, a crowd turning toward a threat. Cheap, readable, and it sells "these actors share a scene" instantly.
Function.Call(Hash.TASK_TURN_PED_TO_FACE_ENTITY, ped.Handle, speaker.Handle, 2000);
Wandering
TASK_WANDER_STANDARD(ped, speed, heading) lets a ped stroll through the local area on ambient paths.
When you need it: filler crowds and background life. You want the neighborhood to look alive without choreographing every drunk and pedestrian — let them wander and reserve your state machine for the actors that matter.
What not to do
Don't teleport visible actors. A ped snapped across the street breaks the world's believability instantly; there is always an animated task that reaches the same destination honestly.