GithubHelp home page GithubHelp logo

hengle / unity---field-of-view-fog-of-war Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kellojo/unity---field-of-view-fog-of-war

0.0 2.0 0.0 2.65 MB

This code snippet can be used to achieve a stealth game like field of view. Thanks to Sebastian Lague (https://github.com/SebLague) for the implementation (https://github.com/SebLague/Field-of-View) of the field of view mechanic. Be sure to check out his tutorial series on the subject.

License: MIT License

C# 100.00%

unity---field-of-view-fog-of-war's Introduction

Unity---Field-of-View-Fog-of-War

This code snippet can be used to achieve a stealth game like field of view. Thanks to Sebastian Lague (https://github.com/SebLague) for the implementation (https://github.com/SebLague/Field-of-View) of the field of view mechanic.

Showcase

Added Peripheral Vision

Features

  • Field of view visualization
  • Edge revolsing
  • Tweakable field of view (radius and width)
  • Peripheral vision (tweakable radius and width)

How to use

  1. Add the "Field of View" prefab to your scene.
  2. Setup the "Target Mask" on the Field of View Component
  3. Setup the "Obstacle Mask" on the Field of View Component
  4. Add the "Hideable" component to the gameObjects that should be affected by the field of view

How to implement your own behaviour

Any MonoBehaviour that should be affected by the field of view needs to implement the IHideable interface which gives you the option to implement the "OnFOVEnter" and "OnFOVLeave" methods yourself.

unity---field-of-view-fog-of-war's People

Contributors

kellojo avatar

Watchers

 avatar  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.