Godot Version
4.5
Question
The function should return true when the player is looking towards the npc, however i think the basis.z is just returning global z.
The code …
var vecToTarget = nav_agent.target_position - position
var dotProd = vecToTarget.normalized().dot( -(player as CharacterBody3D).basis.z)
if dotProd > 0.8:
return true
return false