Forum rules - please read before posting.

Error message on mouseover of hotspot

Hey there,

whenever I move my mouse over a hotspot that has an examine interaction, but no use interaction, my console is flooded with error messages:

NullReferenceException: Object reference not set to an instance of an object
AC.PlayerCursor.DrawCursor () (at Assets/AdventureCreator/Scripts/Controls/PlayerCursor.cs:281)
AC.StateHandler._OnGUI () (at Assets/AdventureCreator/Scripts/Game engine/StateHandler.cs:588)
AC.StateHandler.OnGUI () (at Assets/AdventureCreator/Scripts/Game engine/StateHandler.cs:508)

The result is that no cursor is drawn while hovering over the hotspot, even though an examine interaction exists and an examine cursor is defined in the cursor manager.

Now I've added some debug messages and found out that the following returns null:

 KickStarter.playerInteraction.GetActiveHotspot ().GetFirstUseButton ()

Hence,
  selectedCursor = KickStarter.playerInteraction.GetActiveHotspot ().GetFirstUseButton ().iconID;
returns an error.

This happens with my custom CursorManager, the Default_CursorManager and the Demo_CursorManager. Please let me know if you need any more info.


Thanks,

Matthias

Comments

  • Recreated, thanks for posting.  I'll issue a fix in the next update, but you can get around it with a null check, i.e.:

    Button useButton = KickStarter.playerInteraction.GetActiveHotspot ().GetFirstUseButton ();
    if (useButton != null) selectedCursor = useButton.iconID;

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.