
Follow & Protect Agent is an ML‑Agents powered companion AI that follows the player and protects them from enemies. Plug‑and‑play demo and training setup included.Follow & Protect Agent is a production‑ready companion AI for Unity. The agent follows the player at an optimal distance, detects and engages enemies, and is fully driven by a trained Unity ML‑Agents model. The package includes a clean demo scene for inference, training utilities, and documentation to fine‑tune or retrain the model.Key features:Smart following: maintains optimal distance and orients to the player.Combat AI: detects enemies, aims and shoots with reward‑shaped behavior.Pure NN control: movement/attack decisions come from the ML model.Ready‑to‑use demo: minimal scene with HUD and camera controller.Training tools: config, scene helpers, validation and scene fixer.Clean codebase: English UI, tooltips, and API reference.What’s included:Scripts for Agent, Player, Enemy, Camera, Spawner, Health.Demo scene FPA_DemoScene and Training scene.Trained ONNX model (optional) and training config (PPO).Editor utilities (menu under Tools/FollowProtectAgent).Documentation: README, Quick Start, API Reference, Training Guide.Compatibility:Unity 2022.3+ (Built‑in RP). No external Asset Store dependencies.Works out of the box with primitive objects; can be integrated into characters.Use cases:Companion/guard AI prototypes.ML‑driven behaviors for action or survival games.Educational samples for ML‑Agents workflows.Notes:If you change observation/action spaces, retraining is required.Sentis/ML‑Agents packages should be installed via Package Manager.We use Unity ML‑Agents (PPO) to train the companion AI policy that controls movement, rotation and attack decisions. The agent receives 12 vector observations (player/enemy direction and distance, facing, velocity, health) and outputs hybrid actions (3 continuous + 1 discrete). The package includes the trained ONNX model for inference and the full training setup (scene, YAML config, editor tools) so users can fine‑tune or retrain the policy. No generative content is used; AI/ML is applied strictly to train the gameplay behavior.