Forum rules - please read before posting.

Consistent inventory turn on (speed related)

Hello community,
Hope you are doing fine.
I'll give some context. Out inventory system works in a way that, when you drag the cursor to the bottom (a certain area that triggers the inventory), it appears (it's an animation) from bottom to top. When you move the cursor away from this area, it hides from top to bottom in another animation.
Now, I' found that the speed it shows and hides, is related to how fast you drag the mouse. It's a prefab.
Is there a way to make it consistent disregarding this speed variable? I'm thinking that this is cool and dandy but at some point if the game's atmosphere is dark and dull, I'd rather have an inventory that moves consistently.
Latest AC, Unity 2020.3.27

Comments

  • Can you share a video/gif to demonstrate the behaviour?

    I'm not clear on how the mouse's speed affects things - do you mean that dragging the mouse at different speeds when the menu is off causes it to turn on at different speeds?

    How are you causing the Menu to transition? Let's see your Menu's properties, and UI prefab if appropriate.

  • Yes! Exactly like that. The animator seems to be speeding a bit. The problem is the "off", when I want it out of the way. Maybe it's more Unity related to be honest... but still any clue will suffice.
    https://imgur.com/a/bWmZ2He
    Video is at the bottom.

    Thanks.

  • This isn't so much down to the speed of the cursor itself, but rather a case of the menu being re-opened before it's had a chance to fully close.

    Do the duration of the On and Off animations match the "Transition time" field in the Menu, i.e. 0.45s?

  • Hello. No, they are not. I played with the frames in the animation and that transition to match something I like but honestly I don't understand what "transition" in that slider does. Can you explain me a bit? Do you recommend to use the same value in the there and match it to the total animation frames in the on and off? Something like: if the transition is 0.4, then on and off should both end in 0.3 (0.0, 0.1, 0.2 and 0.3 because 0.4 doesn't exist in the animator).
    This is the way I was hopeing to go!. Let me know your comments. Thanks

  • When AC turns a menu on or off while it's currently mid-transition in the opposite direction, it'll use the Transition time field to work out "how far along" the transition it is. It'll then use this to work out how far along the new transition should be.

    For example, if the Transition is 1 second long, and it was turned on 0.25 seconds ago, then it should start the "off" transition at 75% of its total duration.

    For this to work best, both of your On and Off animations will need to be of the same duration set in the Menu. Your animations can be of any length - whether the Animation window displays the value or not.

  • Hello.
    I'm trying to understand based on what I have and the tests I did.
    For this to work best, both of your On and Off animations will need to be of the same duration set in the Menu. Your animations can be of any length - whether the Animation window displays the value or not.<--Our animations length are 4 samples, 1 second each on and off.

    What would be a good transition to have a consistent "on" and "off speed" based on the one second? I want to get the math right. Both animations are 1 second: I tried 0 and oesn't work at all, and 1 hides extremely fast. So this means that a correct transition should be 0.5? I'm trying to get the logic better.

    Thanks

  • Where are you applying the math? AC isn't dealing with samples - just a transition duration. If your animations are 1 second long, setting 1 in the "Transition time (s)" field should do it.

    What may also help is to have the "Off" state in your Animation to use the "On" animation but with a -1 speed. That might remove any interpolation issues you have if it's not a linear animation.

  • Thank you very much. Everything clarified. Great to have this support :)

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.