Event for Use

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
mandi
Posts: 77
Joined: Wed Sep 16, 2015 4:05 am

Event for Use

Post by mandi »

Is there OnUse event? An event triggered when you use Usable component, with no conversation.
Best!
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Event for Use

Post by Tony Li »

Hi,

It's sent as a message using SendMessage(), so you can just add a method like this to your script:

Code: Select all

public void OnUse(Transform sender) {
    // Your code here
} 
The sender is the GameObject that sent the OnUse message, usually the player.
Post Reply