Hi, I am trying to detect if food object contains to my player object’s sight, but angle is wrong by 90.
I wrote the same code as in this tutorial:
but when I log the angle is greater by 90:
So here is my code:
I don’t know what I am doing wrong really, object in the same layer and parent.
var player = players*;*
var oneFood = food[j];
var foodToPlayer = oneFood.transform.position - player.transform.position;
var angle = Vector3.Angle(foodToPlayer, player.transform.forward);
Debug.Log(angle);