I now have my inventory set to open and close on button click and input toggle, but I want the inventory to also close on Player movement - Walk/Look/Talk interaction. How can I implement this?
If the Player Action for your Interactions have Cutscene while moving?, then your Inventory will be hidden if its Appear type is set to During Gameplay.
Otherwise, you could try a custom script to hook into the OnHotspotInteract custom event to turn the Menu off.
Where do i set Player Action to Cutscene while moving? If i currently set my Inventory Appear Type to During Gameplay, it is on all the time. (usually set to Manual, as the player clicks on an inventory button to open and close the inventory)
Also, anyone able to help with the scripting? As i wouldn't know where to start. Need Inventory menu to turn off on Player Walk, or when a hotspot is interacted with without an inventory item, ie just cursor not inventory object
A Menu can be locked to prevent it from turning on when its "Appear type" condition is met - this can be done with the Menu: Change state Action or through script. Right-click the Start game locked off? property label to get an API reference to modify it in script.
The Cutscene while moving? field will appear if your Player action is set to either Walk To or Walk To Marker.
OK, I will see if i can get someone to help me with scripting, as I don't want to have to tick Cutscene wile moving to hundreds of interactions. Thanks
Also, I'd prefer the inventory to close on walking anywhere, not specifically when clicking on a hotspot. So, I'd need to know how to affect cursor click, rather than walk to
It's an example snippet, not a complete script. You could add it to the inside of an Update() function to have it run every frame.
See the Manual chapter and tutorial on custom events. Events allow you to run code when AC performs certain tasks, for example - when entering "cutscene" mode (OnEnterGameState) and playing speech (OnStartSpeech).
Comments
{
PlayerMenus.GetMenuWithName ("Inventory").TurnOff ();
Keeps telling me it is wrong
Keeps telling me Unexpected symbol 'void'
PlayerMenus.GetElementWithName ("InventoryBag", "Closed").IsVisible (true);
but is is telling me
Assets/TMOWM/Scripts/CloseInventory.cs(24,62): error CS1955: The member `AC.MenuElement.IsVisible' cannot be used as method or delegate