Interactable Script's IsInteractable Setting to False after OnEnable

Nicky_g_

Member
This is strange issue that should be easy but I can't figure out why it is happening.

I'm trying to create a vendor that speaks and then after saying his dialogue opens up the Shop Menu.

It works perfectly the first time but when I try to attempt to open the shop again it doesn't work. How come the Is Interactable of the Interactable script sets to false after I enable the gameObject to true?

Here is a video of my issue:

 
On the Interactable Behaviour you have the "Deactivate On Interact" ticked on, try ticking that off
1610526991814.png
 
Thanks for the speedy reply!

The Deactivate On Interact is enabled on purpose. I want the trigger to turn off almost immediately after it turns on so that when the player is not interacting with the NPC the inventory won't open.

Right now I have Dialogue System turning the trigger on after the dialogue is over so that the player can access the shop after reading the NPC's message.

My goal is to have the player approach the NPC, press an action button, display the NPC message, and then lastly open the shop. If the player doesn't interact with the NPC then the shop is inaccessible. Is there a way to do this or should I create a script that turns the trigger off when the menu UI is turned on?

This is a pretty common thing in games so I feel like I'm doing a hack instead of the correct implementation.
 
Are you using the Pixel Crushers Dialogue System?

If that is the case I would recommend you contact @Tony Li about this. I believe he was working on a solution for that exact use case a few days ago.
 
I am and I will. Thank you!

I'll mark this as answered and I'll edit it with the solution once I know it so that if someone else looks for the answer it'll here waiting for them.
[Edit]

Here is the reply I got from Tony:
Hi! Please use latest Dialogue System integration on opsive.com. Select menu item Edit > Project Settings. In the Player section, Other Settings subsection, add ";UIS" (without quotes) to the end of the Scripting Define Symbols field.

This tells the Converse ability to check if the conversation opened the shop menu so it can handle it properly.

In your conversation, use the OpenShop() sequencer command to open the shop (typically on a final dialogue entry node).
Example: OpenShop(ShopKeep,,Jody)
(Assuming the GameObject with the Shop and ShopMenuOpened is named "ShopKeep" and the player with the Inventory component is named "Jody".)
Worked like a charm. The only point of clarification is that its the Ultimate Inventory System Integration manager integration that must be imported, not the UCC Integration.
 
Last edited:
Top