#Is there a way to check if my player is looking at something without a raycast or any physics?
1 messages · Page 1 of 1 (latest)
hi @hybrid raven I solved it 🙂 I used the dot product
yep, what you said 🙂
float angle = Vector3.Angle(transform.forward, sphere.transform.position - transform.position);
if (Mathf.Abs(angle) < 10)
code if anyones interested, will mark it as solved

Keep in mind that this will check in a 20° cone, because you're comparing to 10° either side of the direction.
ah yes your right there
Also, Vector3.Angle will always be between 0f and 180f, so using Mathf.Abs is unnecessary here.
oh ok thank you!
are you able to help me with something @hybrid raven
just a little something and if you dont know no worries then 🙂
How am I supposed to know if I can help you, when you have not told me the issue?
Besides, if that was the reason you sent a friend request - please don't add me, just to ask me stuff.