What's the best way for me to code a custom action for a Usable item?

nethergram

New member
Hello,

I have an equippable item that has a small video screen. When I click use, I want a custom action to play that switches the video on the screen based on a couple of factors. I was able to do this successfully using a script attached to my custom Item that I made using the item manager.

However, I'm wondering if I am doing this wrong. I don't know how it works and the docs weren't clear to me, but would the best course of action be to add an action that utilizes a Unity event in a script attached to my item?

I am thinking a Unity Event is simply a function call. If I am wrong, what's the best way to structure an action like this in UCC?

Thank you!
 
You could use unity events, or the more "proper" way would be to use the module system. For something like this you could create a new ItemEffect module that gets trigger within the Usable Action Module group. Take a look at the LightEffect with the flashlight for an example.
 
You could use unity events, or the more "proper" way would be to use the module system. For something like this you could create a new ItemEffect module that gets trigger within the Usable Action Module group. Take a look at the LightEffect with the flashlight for an example.
Thanks Justin, I'm going to look at the code tonight to see if I can create my own. Appreciate your help.
 
Back
Top