Biomechanically Constrained Gaze Control for NPCs in Unity: A VHP-Based Approach with Context-Aware Target Prioritization
Abstract
Introduction: Gaze is a central non-verbal cue for communicating attention, intention, and social presence in virtual characters. In games, however, Non-Playable Characters gaze and aiming behavior often remain mechanically rigid, visually inconsistent, or weakly connected to scene context. Objective: This paper presents a Unity-based gaze-control extension for the Virtual Human Project (VHP), designed to improve the plausibility of NPC gaze through biomechanical constraints, binocular coherence, and context-aware target prioritization. Methodology: The proposed approach modifies the VHP gaze pipeline with three mechanisms: angular eye clamping based on human ocular ranges, a unified focal-center strategy that prevents asymmetric eye convergence, and a target-weighting layer that increases gaze priority for semantically relevant objects. The system was implemented in Unity and analyzed through controlled runtime cases involving extreme gaze targets and multiple competing points of interest. Results: Runtime traces and visual inspections show that the extension limits excessive yaw and pitch, avoids cross-eye artifacts from independent per-eye constraints, supports head-eye coordination, and biases target selection toward user-defined contextual-priority objects without replacing the VHP gaze pipeline.