[HOWTO] How To: Use Usable Events

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

[HOWTO] How To: Use Usable Events

Post 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 533 times
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: [HOWTO] How To: Use Usable Events

Post 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
Post Reply