- Home /
Paint the angle of AI
I was just wondering if I can "paint" the angle of my AI? his field of vision
Just so I can see it myself when I'm playing, if I need to increase it or decrease it as it's quite hard not seeing it.
I hope this made any sense
thanks in advance
Answer by Cherno · Jan 16, 2015 at 03:07 AM
If the fov is fixed to, say, 90 degrees or something, you can just create a simple mesh shaped like a flat cone, make it's pivot/origin perpendicular to the line running through it halfway, and then making it a child of the enemy object. Now you can see where his vision cone is because the plane will rotate with him.
You can also use one of the GUI drawing functions available on the net and the Unity wiki to just draw two lines, indicating the max extends of his fov. You could even use LineRenderers.
Look for one by Yossarian $$anonymous$$ing based on a line drawing routine originally courtesy of Linusmartensson: link
Your answer
Follow this Question
Related Questions
How to get the growth of an angle from touch 1 Answer
problem with vector3.Angle with a fixed joint 2 Answers
2d Raycasting, trouble drawing rays at the correct angles 1 Answer
2D - Sprite based on angle 0 Answers
Angle slider 0 Answers