Page 1 of 1

Event for Use

Posted: Tue Mar 01, 2016 6:35 am
by mandi
Is there OnUse event? An event triggered when you use Usable component, with no conversation.
Best!

Re: Event for Use

Posted: Tue Mar 01, 2016 8:50 am
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.