Unity logo
Cancel
Cart
Applications
Sell Assets

Over 11,000 five-star assets

Rated by 85,000+ customers

Supported by 100,000+ forum members

Every asset moderated by Unity

Home
Tools
Behavior AI
This content is hosted by a third party provider that does not allow video views without acceptance of Targeting Cookies. Please set your cookie preferences for Targeting Cookies to yes if you wish to view videos from these providers.
1/5

This asset package contains scripts/prefabs to help you build you Canvas based 2D games that need line of sight detection with visible/invisible FOV cones. The asset includes 2 demo scenes one for top-down, one for sidescrolling behavior. The system is designed to be variable in it's performance impact and runs well on mobile as well on PCs.

The project has been developed with Unity 2019.3 but also works with 2019.2. Previous Unity Versions are not supported by the custom editor and the prefabs.



Features:

- Custom Editor for easy setup

- Multiple options to tailor the performance for your target (Mobile/Desktop)

- Highly customizable

- Variable FOV from 1° - 180° degrees

- Variable detection distance

- Automatic rotation from 1° - 180° degrees to the left/right (can stop on detection) with variable speed

- The FOV cone can be set to visible/invisible

- Color for detected/undetected can be set and animated

- Custom sprites for detected/undetected state can be set for the FOV cone

- Multiple tags which trigger detection can be set

- Multiple layers on which the raycast for the line of sight detection is being made can be set

- Raycast only happens when a target object enters the detection radius of the search object

- Detection interval (when the raycast is made) can be set between 0.1 and 5.0 seconds to save on performance

- The density of the rays used for the raycast is variable to save on performance

- The search direction can be toggle from middle to the outside or outside to the middle

- In the editor debug rays can be drawn during gameplay to help debugging gameplay

- Custom Unity Events can be added via the editor when an object is detected or has been lost by detection. The events pass the GameObject of the detector as well as the detected object to easily implement further functions

- Helper function to rotate elements with the FOV cone is included



The code is extensively commented and a pictured pdf documentation is included.

If you encounter bugs, have questions or wishes for the functionality, contact me via the supplied email.

2D Line Of Sight Detection System

(not enough ratings)
23 users have favourite this asset
(23)
$8
Seat
1
Updated price and taxes/VAT calculated at checkout
Refund policy
This asset is covered by the Unity Asset Store Refund Policy. Please see section 2.9.3 of the EULA for details.
Secure checkout:
Supported payment methods: Visa, Mastercard, Maestro, Paypal, Amex
License type
File size
7.0 MB
Latest version
1.0
Latest release date
Jun 17, 2020
Original Unity version
2019.3.6 or higher
Quality assets
Over 11,000 five-star assets
Trusted
Rated by 85,000+ customers
Community support
Supported by 100,000+ forum members
Unity logo
Language
Feedback
Partners Program
Partners
USD
EUR
Copyright © 2025 Unity Technologies
All prices are exclusive of tax
USD
EUR