Can an actor see?

Hi all. First post so be kind if it's a dumb question. Basically can Actor A be made to move towards Actor B (only using AI…not controlled by the player) ONLY when there is a clean line of sight between the two?

i.e. if Actor B is positioned behind a wall then Actor A will not react. But once Actor B becomes visible to A then A will move towards him.

Thanks

Roj

Answers

  • revoltandreverbrevoltandreverb Member Posts: 159

    You can create a boolean like is_in_line_of_site and then you can try shooting invisible bullets at the other actor constantly/automatically by tracking the other actor's position for the direction of the bullets, and only if the other actor is hit within a certain amount of time then you can change the boolean to true else false. If there is a wall between the actor the bullets won't reach the other actor.

  • roj woolleyroj woolley Member Posts: 2

    yeah get it! I never thought of it from that angle.

    I'm sure I read somewhere that in the past that's how people thought eyesight actually worked in the real world!

    Thanks

  • revoltandreverbrevoltandreverb Member Posts: 159

    Cool, let me know if it works out.

Sign In or Register to comment.