Proximity
A proximity system adds dynamic interactions by triggering events based on nearby objects, making the game world feel more responsive.
Last updated
A proximity system adds dynamic interactions by triggering events based on nearby objects, making the game world feel more responsive.
Last updated
The Proximity System is divided in two parts:
Proximity Trigger
- triggers a proximity whenever it gets close to any AProximity
.
AProximity
- an abstract class that is easy to extend and gets triggered whenever the Proximity Trigger
is getting close or leaves the proximity area.
The Proximity Trigger
can be attached to any game object. For example; we can attach it to the player instance.
The AProximity
cannot be directly used due to it being an abstract class. However, you can and should create a new script and extend the AProximity
class. Here you can define whatever proximity behaviour you want. Let's take an example where a sphere changes its color: