by SolarPortal » 23 Apr 2015, 17:45
yes, this can be used for enemy AI or other NPC's in the scene, not just the player. It is also not physics based, so there are many use cases for this snippet.
This could be used to chase the player if you wander into their sights or sneak up on them. But once they have sighted you, you need to use waypoint(spline paths) or navmesh(pathfinding) in order to follow the player around a complex environment, otherwise they end up running into a wall. The best way of saying is that it compliments a pathfinding solution(spline paths or navmesh).
Hope that makes sense

Conceive, Quantify & Do!
Skyline Game Engine - Lead Developer.
Please provide as much information as possible when asking for help.
Specs: OS: Win 10 64bit, CPU: Intel i7 3770 3.4ghz x 4 core(8 threads), GPU: Nvidia GTX 1060 6GB, Ram: 16gig DDR3, Windows on 250gb Samsung Evo 860