Unity - How to trigger objects player is looking at

Опубликовано: 20 Октябрь 2017
на канале: IBQX
3,503
63

Showing how to create script that triggers some functions when player is looking at object. This is useful when you want to create 3D buttons or just select and modify object when player is looking at it.

We will create class that has virtual "OnRaycastEnter", "OnRaycastLeave" and "OnRaycast" methods. This class can be derived so you can create multiple different implementations from it.