Besides finding out when something moves through a trigger, we can also find out what entity it was. To do this, we’ll add a parameter to the trigger functions. This has the type Entity because any entity can activate the trigger events.
- Add a parameter called something to the onTriggerEnter function.
- Use : colon to give the parameter the type Entity.
- Add something.name into the console.log, and use + plus to attach it to your string.
Repeat this with the onTriggerStay and onTriggerExit functions