Page 1 of 1

[HOWTO] How To: Use Usable Events

Posted: Thu Aug 08, 2024 4:34 pm
by Tony Li
If you're using a Selector or Proximity Selector to interact with Usables, you can configure the Usable component to do things when selected (such as activating a highlight), deselected, or when used. In the example below, the Box plays a sound and calls its PickupScript's PickUpItem() method when used:

usableOnUseExample.png
usableOnUseExample.png (48.17 KiB) Viewed 532 times

Re: [HOWTO] How To: Use Usable Events

Posted: Thu Aug 08, 2024 8:34 pm
by Tony Li
Note: If you're deactivating or destroying the object, you'll want to play the audio on a different object. The example scene below has a cube that you can click on to "pick it up." This plays a source on the player's audio source and deactivates the cube.

DS_PickupCubeExample_2024-08-08.unitypackage