- Home /
Question by
Jbors012 · Aug 28, 2020 at 09:30 PM ·
c#2draycastraycasting
Cast multiple rays from an object between two angles?
Hi,
I am trying to make an Enemy AI for a 2D game I'm making using 2D raycasts to simulate vision. I wanted to cast multiple rays between -45 and 45 degrees of the enemy to create its field of vision. I have tried simply creating many rays, but this seems clumsy and inefficient. Is there any better way to do this?
Thanks in advance.
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613010718im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Raycast goes throught objects [C#] 1 Answer
Raycasting not working? 1 Answer
C# Raycast goes straight into the air 2 Answers
Reverse object position order 1 Answer