Giter Club home page Giter Club logo

fieldofview's Introduction

FieldOfView

A simple Field of View system for the Unity Engine with target detection and obstacle blocking

How To Use

  • Import both scripts into your project

  • Ensure FieldOfViewEditor is inside of the Editor folder inside of Unity or else your build will fail to compile!

  • Set up two new Layers, one for your Target objects and one for your Obstacle objects

New Layers

  • Set your player (target) to be on the Target layer

  • Set any obstacles that block the enemies field of view to be on the Obstacle layer

Field Of View Inspector

  • Attach the FieldOfView script to your Enemy

  • Configure the view radius and angle properties to your liking

Field Of View Inspector

  • Set the target layer mask to be your Target layer

  • Set the obscruction layer mask to be your Obstacle layer

FAQ

Why isnt my raycast detecting the player / obstacles?
Check your objects have colliders, Raycasts need to hit colliders to work
Check your objects are assigned to the correct layers
Check your FieldOfView script is looking at the right layers in the inspector

Why is my build failing with these scripts?
FieldOfViewEditor needs to be inside a folder called Editor

fieldofview's People

Contributors

comp3interactive avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.