Forum rules - please read before posting.

May have deleted menu element

I have this error happening. 

NullReferenceException: Object reference not set to an instance of an object
AC.MenuPreview.Update () (at Assets/AdventureCreator/Scripts/Menu/MenuPreview.cs:58)

I may have deleted a menu element, but I'm not sure. I no longer see my character's name when he speaks.

Any suggestions?

Comments

  • In what version of AC?

    That does suggest an element's been nullified, but deleting one in your Menu Manager shouldn't cause that.  Have you opened the relevant Menu in your Menu Manager to see if the element is still there?

    Though it might be an annoyance, one sure-way to fix this would be to delete the whole Menu itself and rebuild it.  You can copy the Subtitles Menu from the Demo_MenuManager asset and paste it into your own Menu Manager for convenience.
  • edited September 2016
    Also, in case you did delete it, make sure you are not trying to activate it through an action. Check your action lists to make sure none is trying to turn on or off the missing menu. (may not be that, seeing how the error is in "MenuPreview" but it doesn't hurt to be safe I guess)
  • Thanks for the tips guys. I'm using v1.53d.

    I ended up replacing my menu manager from the 2D demo and it worked out. I like the feel of this UI much more. Now my Character's name still doesn't show up when he talks, which is fine, but I'm still a bit confused as to how I would add that feature to the dialogue or remove it if it was there. 

    Is there  a tutorial on customizing these sorts of elements?
  • I see the tutorial now, too bad I hate reading words. Video tutorials are better!

    Eh but anyway, I have a question. How would one make it so the highlight in the menu is not aligned left with the text? I don't see any way to center the highlight only.

    image
  • edited September 2016
    Well, as far as I know a label or button is inherently a container with a square shape (or other shapes in some cases), but is regardless just a container image. The highlight image in this case just covers the whole square button. Which is normal. The issue here is not how to align the image to the text, is the opposite. The text is the one that's aligned to the bottom and the left side, giving you the impression that the highlight is offset, when it's the text that's offset. What you can do is go to your buttons or menu and make sure the text in all buttons is aligned to the center and/or Aligned to the middle (they'll be there, but I'm not close to my PC so I can't recall the exact wording). Anyway, that will put the text in the center of the button and everything will look correct.
  • For greater control over the way your Menus look, you can build them with Unity UI and have AC control them.  A tutorial on linking Unity UI to AC's Menu system can be found here - and there's a link to a video example at the top.
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.