• Stars
    star
    143
  • Rank 257,007 (Top 6 %)
  • Language ShaderLab
  • License
    MIT License
  • Created almost 5 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Commandos cone of sight implemented in Unity3D

Commandos cone of sight in Unity3D

This project shows how to implement Commandos cone of sight fx in Unity3D.

This effect is also present in other games such as Desperados, Shadow Tactics or Brawl Stars.

It is implemented using a secondary camera depth texture instead of raycasting. This camera is attached to the soldier, which allows the effect to be accurate in terms of what the character could actually see.

The cone angle can be tweaked on the ConeOfSightRenderer component (which is on the ConeOfSight object, in the Soldier prefab).

The shader works like a deferred decal so this effect would work with different terrain heights if the cube (rendered by ConeOfSight) is tall enough.

Cone of Sight demo

Assets

ToonSolider WW2 by PolygonBlacksmith

Tank by Game-Ready Studios

Oil Tank by Rakshi Games

Industrial Building by ReinforcedCC