Forum rules - please read before posting.

All Inventory Unhandled Interactions stopped working

Hi, I have an issue that has appeared out of nowhere, everything has been fine until now, but for some reason all of my inventory item's unhandled interactions don't work anymore, but they were fine, i maybe clicked something in settings that I shouldn't have? unhandled combine inventory items works fine still and using them on the correct hotspots works as usual too. Only unhandled interactions on hotspots are broken, it just does nothing at all :/ hopefully someone has seen this before or might have an idea what has happened? Thanks in advance!

Comments

  • Lets see your Settings Manager, a typical Hotspot component, and your Inventory Manager. What's your AC version as well?

  • Thanks Chris i will grab some screenshots of that. I also just noticed that the console shows an error when i try to use an inventory item an unhandled hotspot, it says this: NullReferenceException: Object reference not set to an instance of an object
    AC.PlayerInteraction+d__26.MoveNext () (at Assets/AdventureCreator/Scripts/Controls/PlayerInteraction.cs:946)
    UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <31d5d65b32ec483292e13e8ae4100b93>:0)
    UnityEngine.MonoBehaviour:StartCoroutine(String, Object)
    AC.PlayerInteraction:ClickButton(InteractionType, Int32, Int32, Hotspot) (at Assets/AdventureCreator/Scripts/Controls/PlayerInteraction.cs:924)
    AC.PlayerInteraction:HandleInteraction() (at Assets/AdventureCreator/Scripts/Controls/PlayerInteraction.cs:734)
    AC.PlayerInteraction:ContextSensitiveClick() (at Assets/AdventureCreator/Scripts/Controls/PlayerInteraction.cs:538)
    AC.PlayerInteraction:ChooseHotspotThenInteractionClick_Process(Boolean) (at Assets/AdventureCreator/Scripts/Controls/PlayerInteraction.cs:378)
    AC.PlayerInteraction:ChooseHotspotThenInteractionClick() (at Assets/AdventureCreator/Scripts/Controls/PlayerInteraction.cs:362)
    AC.PlayerInteraction:HandleInteractionMenu() (at Assets/AdventureCreator/Scripts/Controls/PlayerInteraction.cs:151)
    AC.PlayerInteraction:UpdateInteraction() (at Assets/AdventureCreator/Scripts/Controls/PlayerInteraction.cs:92)
    AC.StateHandler:Update() (at Assets/AdventureCreator/Scripts/Game engine/StateHandler.cs:356)

  • AC version is v1.60.4

  • What is on line 946 of the PlayerInteraction script?

    A little above, you should find the line:

    if (hotspotMovingTo == hotspot && KickStarter.playerInput.LastClickWasDouble ())
    

    Try replacing it with:

    if (hotspotMovingTo && hotspotMovingTo == hotspot && KickStarter.playerInput.LastClickWasDouble ())
    
  • Hi Chris, that didn't work I'm afraid, but there have been changes made to the playerinteraction script when you were helping me with the double click exits issue before: https://adventurecreator.org/forum/discussion/12694/double-clicking-to-exit-room-immediately-problems#latest

    The console now says this:
    NullReferenceException: Object reference not set to an instance of an object
    AC.PlayerInteraction+d__26.MoveNext () (at Assets/AdventureCreator/Scripts/Controls/PlayerInteraction.cs:946)
    UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <31d5d65b32ec483292e13e8ae4100b93>:0)
    UnityEngine.MonoBehaviour:StartCoroutine(String, Object)
    AC.PlayerInteraction:ClickButton(InteractionType, Int32, Int32, Hotspot) (at Assets/AdventureCreator/Scripts/Controls/PlayerInteraction.cs:924)
    AC.PlayerInteraction:HandleInteraction() (at Assets/AdventureCreator/Scripts/Controls/PlayerInteraction.cs:734)
    AC.PlayerInteraction:ContextSensitiveClick() (at Assets/AdventureCreator/Scripts/Controls/PlayerInteraction.cs:538)
    AC.PlayerInteraction:ChooseHotspotThenInteractionClick_Process(Boolean) (at Assets/AdventureCreator/Scripts/Controls/PlayerInteraction.cs:378)
    AC.PlayerInteraction:ChooseHotspotThenInteractionClick() (at Assets/AdventureCreator/Scripts/Controls/PlayerInteraction.cs:362)
    AC.PlayerInteraction:HandleInteractionMenu() (at Assets/AdventureCreator/Scripts/Controls/PlayerInteraction.cs:151)
    AC.PlayerInteraction:UpdateInteraction() (at Assets/AdventureCreator/Scripts/Controls/PlayerInteraction.cs:92)
    AC.StateHandler:Update() (at Assets/AdventureCreator/Scripts/Game engine/StateHandler.cs:356)

  • What is on line 946 of your PlayerInteraction script?

  • Hi Chris this is line 946:
    bool skipSnapping = (button.playerAction == PlayerAction.WalkToMarker && !button.isBlocking && doSnap);

  • Replace with:

    bool skipSnapping = (button != null && button.playerAction == PlayerAction.WalkToMarker && !button.isBlocking && doSnap);
    
  • Fixed! thank you very much Chris, amazing support as always!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.