Forum rules - please read before posting.

Animating menu graphic

I'm emulating a die roll by animating a graphic menu element for a while, before exchanging it for a graphic of another randomised graphic (the sides of the die).
I know this is a bit of an ugly solution, and that I should probably turn to Unity UI and learn to do it properly, but I actually got it to work quite well, for a while.
Then the graphic suddenly stopped working, after I changed the entire menu, and now it won't animate. Is this functionality a bit compromised? I can put the graphic element on various other menus and sometimes it works, sometimes it doesn't, even though the menus have - as far as I can see - identical settings.
I've imported a sprite sheet with the 8 versions of the die, checked the animated box, set the correct amount of frames, rows and columns, etc.

If this is a super awkward way to do it, maybe I can get a nudge in the right direction, if I should try Unity UI instead?

Comments

  • I'll always recommend using Unity UI over AC menus, and especially so when it comes to animation.

    The AC approach shouldn't break intermittently without reason, though. Does the Console reveal any relevant information, and have you marked the texture involved as "Read/Write Enabled"?

    You're welcome to share screenshots of the texture and Menu/Element properties involved, though this kind of situation is trivial when using Unity UI - as you can simply attach an Animator component to your Image object and playback animation in the Unity-standard way.

  • Thanks, I'm switching to Unity UI then.

    A few pointers to get me started; with AC menus it was easy to show variables in labels (with [var] etc), but what's the quickest way to do the same with a text object in the unity UI? Or can I add AC labels on top of the Unity UI prefab? I feel slightly lost when it comes to integrating the two systems...

    Also, are all the elements in a Unity UI to be treated as objects, as opposed to in AC when I turn on and off stuff using Menu->Show Elements etc?

  • edited November 2022

    it was easy to show variables in labels (with [var] etc), but what's the quickest way to do the same with a text object in the unity UI?

    In both menu types, label text is set inside the Menu Manager - so [var] tokens are still available and used in the same place.

    Also, are all the elements in a Unity UI to be treated as objects, as opposed to in AC when I turn on and off stuff using Menu->Show Elements etc?

    Each element slot becomes a separate object, yes, but the "Show/Hide element" feature will work for Unity UI as well.

    If you want to see the workflow of working with Unity UI and AC's Menu system, have a watch of this section of the First Person Primer tutorial.

  • Thanks for quick replies.
    When I work with a Unity UI I open a new scene and put the stuff together there, but if I am to add labels using the AC menu manager, how can I see what I'm doing? The game window doesn't show the UI like it would when the menu source is all AC

  • AC will only update the UI visually at runtime. If you want to get an idea of how things would look, you'd have to modify the Text components in the UI itself. AC will replace their contents at runtime with those set in the Menu Manager.

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.