Forum rules - please read before posting.

Unity UI Custom animation issue

Hey, 

My inventory and interactions menus are built in Unity. They are setup exactly the same: custom animations with the 4 required states. Transition times are set to 1s. 

I want them both to have a looping animation in the OnInstant state. So the animation clip for OnInstant is set to loop, and there is a transition in the animator from On > OnInstant. 

The Inventory menu works absolutely fine. 

But the Interaction menu behaves weirdly. When I click a hotspot for the first time it works fine. It goes to On>OnInstant (looping). When I exit the hotspot, it also seems fine. But when I click another a hotspot after that, it only starts the On state for a split second then disappears. When I exit the hotspot area, the menu reappears without transition. 

However, it works perfectly when I change the custom animation transition time to 0. Unfortunately, it gets rid of my Off animation.

Settings are:

- Choose Hotspot then Interaction
- Select interaction by Clicking Menu
- Close interactions with Cursor Leaves Menu or Hotspot

Any idea how to fix this?

Comments

  • Welcome to the community, @fffff.

    Have you assigned the RectTransform boundary field in your Menu's properties?  That's used by AC to determine if the cursor has "left the Menu", so if that's improperly configured it will turn itself off inappropriately.  What is the difference in behaviour if you temporarily set Close interactions to Click Off Menu?

    I shall try to recreate the problem.  Which versions of AC and Unity are you using, and how does your Interaction menu differ from the default Interaction / InteractionUI menu + Canvas prefab?
  • Hi Chris, 

    thanks for the support and quick response. Main differences with the provided Unity UI example are:

    - interaction buttons are children of the UI panel. I have tried moving them up in the hierarchy but it doesn't change anything.

    - pivot point and anchors of the panel are set to the centre left (I want the buttons to appear to the right of where I click without wasting too much space on the left). I tried centring everything but it doesn't make a difference either. 

    The RectTransform boundary is set to the UI panel. I have tried creating another panel and using it for boundaries, but the problem persists.

    I set Close interactions to Click Off Menu. The menu still behaves weirdly, appearing and disappearing at different points, I can't work out why exactly.

    Could it be a problem due to the animations and how AC calculates where hotspot boundaries are? Sorry I'm really stumped as it's the only difference between my inventory menu, which works perfectly fine. 
  • A few more details: 

    Menu appear type: On Interaction
    Position type: Appear at Cursor and Freeze (tried On Hotspot and didn't fix it)
    Updating while Fade Out: yes (tried No, didn't fix)

    One more note: the menu behaves fine when I change Transition Type to None, (or as previously mentioned, when it's set to Custom Animations with a transition time of 0 seconds). But then I don't have an Off animation when the menu is turned off.

    So something in the animation transition is messing up with the animation clips?

     
  • I can't recreate - being a visual issue I'm going to need to see it for myself.  If you can prepare a .unitypackage file of the Managers, UI prefab, and associated animation/graphic files, PM it to me and I'll take a look.
  • UPDATE: in case someone has the same problem, Chris found the reason it was behaving weirdly. I had a Canvas Group on the main canvas and the alpha wasn't set properly for ALL the animations. 


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.