This image explains what I want in a nutshell for a unit in an RTS
Essentially, the Field of Vision gameobject in the image would have a script attached to it that morphs shape when it runs into a new gameobject.
I have no idea how to code this script. It emulates what a person’s field of vision would look like if he looked at a wall. He cannot see through the wall so his field of vision shrinks slightly.
Here is what the field of vision would look like with no obstruction.
@MJMC brought up a good point so I must add that:
- the player can see the other side of obstructing gameobject, but the gameobject cannot. Think of a unit from Command and Conquer or Starcraft.
- the field of view gameobject must be able to detect collisions.
Tutorial link : Field of view visualisation (E01) - YouTube
Note: I think the title for this question is horrible! Suggestions welcome