Hello,
I have an inventory item that needs to be drag and dropped onto a hotspot.
This hotspot is a specific location on a TV screen and I would like the TV screen to light up when this item hovers over the area.
If I use "Object to Highlight" of the target Hotspot, it works, but any item triggers it.
I would like this to only happen when it is the right item, is this possible?
Thanks.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
You can attach a custom script that hooks into the OnInventorySelect / OnInventoryDeselect custom events to have the Hotspot automatically turn off when any Inventory item except the one in question is selected (and turn on again when deselected):
Thanks Chris, but I have 4 CS0123 errors:
No overload for 'OnInventoryDeselect' matches delegate 'EventManager.Delegate_Inventory'
on the instructions:
EventManager.OnInventorySelect += OnInventorySelect;
Sorry, that's my fault.
I've corrected the script above - give it another try.
Thanks Chris,
By changing the first hotspot.TurnOn(); in TurnOff, it works:
When the desired item flies over the area, the TV lights up, when it is another item, the TV does not light up.
But when the empty cursor hovers over the area the TV lights up too, , even if the inventory is empty, that's a problem.
Here's an alternative script that will turn the Hotspot on only when the specific item is selected:
Thanks Chris, it works perfectly!