#✅ | Element Animator: My mortal enemy

1 messages · Page 1 of 1 (latest)

merry marsh
#

I have an animation set to play when a button is hovered, but once the animation completes, hovering does not trigger it again. Why.

fallen foxBOT
#

Hi! 👋 Please first click the button below to start this support ticket.

⚠️ It is not possible for anybody to send messages in this ticket before it has been started, so you need to click the button for others to be able to help/answer you.

fallen foxBOT
# merry marsh I have an animation set to play when a button is hovered, but once the animation...

This could be related to Button hover animation behaving oddly after hover in FancyMenu 3.9.1 👀

The reason is usually simple: the Element Animator does not automatically restart just because the button is hovered again. After it finishes, it stays at its last state until you reset it.

Fix:

  • On hover start: Reset Element AnimatorEnable Element Animator
  • On hover end: Disable Element Animator

So the important part is the reset action. Without it, hovering again just re-enables an animator that already finished, so nothing visibly happens again.

If you want, send me your /logs/latest.log right after it happens and I can check whether it’s just setup or an actual bug 🫩

merry marsh
#

Where do I plug in the hover start elements again?

fallen foxBOT
# merry marsh Where do I plug in the hover start elements again?

Put them in a Ticker element’s action script 👀

There is no special “hover start” slot for buttons in the docs, so the usual setup is:

  1. Add a Ticker
  2. Right-click it → Manage Action Script
  3. Add an IF with the requirement Is Element Hovered
    • value = your button’s element ID
  4. Inside the IF, add:
    • Reset Element Animator
    • Enable Element Animator
  5. In the ELSE branch, add:
    • Disable Element Animator

So the hover logic lives in the ticker, not in the button click script.

If you want, I can sketch the exact action script layout for you step by step 🤝

merry marsh
#

Added the ticker and now the element isn't showing up at all

fallen foxBOT
merry marsh
fallen foxBOT
# merry marsh
Minecraft Log Analysis

Log Overview
The game did not crash, but the server encountered several fatal execution errors. The main issue is a recurring NullPointerException triggered by the Sophisticated Building mod (sophisticatedbuilding) during undo (perform_undo) operations. This occurs when the block placer utility attempts to reconstruct a block state that returns a null item reference.

#

Potential Problem Solutions
To resolve this issue, consider updating Sophisticated Building to the latest version. If you are already on the latest version, report this bug to the mod developer with a list of blocks you attempted to undo. Avoid using the undo function on custom modded blocks or blocks that do not have a standard item representation.

#

Minecraft
Minecraft Version: 1.21.1
Mod Loader: NeoForge
Mod Loader Version: 21.1.234

Detected Optimization Mods
Sodium, Iris, Flywheel

Compatibility-Relevant Mods
Essential: Not detected
Distant Horizons: Not detected
Sinytra Connector: Not detected

Important Mods
JustZoom Version: Not Detected
FancyMenu Version: 3.9.1
Spiffy Version: Not Detected
Drippy Version: Not Detected
Konkrete Version: 1.9.9
Melody Version: 1.0.10
MCEF Version: Not Detected
FER Version: Not Detected
WaterMedia Version: Not Detected
WaterMedia Binaries Version: Not Detected

fallen foxBOT
# merry marsh

Yep, that usually happens because the ticker is resetting the animator every tick while the button is still hovered 😵

So the animation keeps jumping back to its first keyframe.

Two likely causes:

  1. Reset Element Animator runs continuously
  2. Your first keyframe is invisible / off-screen / size 0, so the reset makes the element look gone

Best fix: make the hover action run only once when hover starts
Use a variable to remember the hover state:

  • If button is hovered and hover_state is false

    • Reset Element Animator
    • Enable Element Animator
    • Set Variable Value: hover_state:true
  • If button is not hovered and hover_state is true

    • Disable Element Animator
    • Set Variable Value: hover_state:false

Also make sure the first keyframe is visible. If it starts hidden, the reset will make it disappear.

If you want, I can write the exact ticker action script layout for you 🤝

merry marsh
#

I can't make the first keyframe visible, the entire point is for the element to emerge from behind something else

fallen foxBOT
# merry marsh I can't make the first keyframe visible, the entire point is for the element to ...

Yep, that’s totally fine 🙂
The first keyframe does not need to be visible.

What matters is this:

  1. Element Animator only controls position/size/anchor

    • It does not control layering / draw order.
  2. So if the element should “come out from behind” something, that covering element must be in front in the layer order.

    • Use Window -> Widgets -> Layers
    • Or right-click the element and use Move One Layer Up/Down
  3. Your hover trigger must still be one-shot

    • Don’t keep calling Reset Element Animator every tick while hovered
    • Only run it when hover starts
    • On hover end, Disable Element Animator

So the setup is basically:

  • cover element: above
  • animated element: below it
  • reset + enable: only once when hover starts

If you want, I can give you the exact hover ticker logic for:

  • covered by a custom element, or
  • covered by a vanilla widget 👀
merry marsh
#

So the hover_state variable is defined in the hovered element's action script, right?

fallen foxBOT
# merry marsh So the `hover_state` variable is defined in the hovered element's action script,...

No, hover_state is not defined inside the hovered element 🙂
It’s just a normal FancyMenu variable.

How it should work:

  • Create hover_state once in Customization -> Variables -> Manage Variables
  • Set its default value to false
  • Your ticker checks the hover condition
  • The ticker updates hover_state to true or false

So the variable is global to FancyMenu, not owned by the hovered element.

In short:

  • hovered element = just the thing being checked
  • hover_state = shared FM variable used to remember whether the hover animation already started

If you want, I can write the exact ticker logic for you next 🤝

merry marsh
#

I know the variable is global, I was asking about what defines its true/false state. Just add it in the ticker, then?

fallen foxBOT
# merry marsh I know the variable is global, I was asking about what defines its true/false st...

Yes, the ticker is what defines the state 👍

hover_state is just the memory flag. The ticker should set it like this:

  • If button is hovered and hover_state is false

    • Reset Element Animator
    • Enable Element Animator
    • Set Variable Value: hover_state:true
  • If button is not hovered and hover_state is true

    • Disable Element Animator
    • Set Variable Value: hover_state:false

So the variable is not “owned” by the button. It’s simply updated by the ticker based on the hover check.

If you want, I can write the exact action script structure in FancyMenu’s IF / ELSE format for you 🤝

merry marsh
#

Please do, mine doesn't seem to be working

fallen foxBOT
# merry marsh Please do, mine doesn't seem to be working

Yes, the ticker is what should define it 🤝

Set hover_state to false once in Manage Variables, then use this exact logic in the ticker:

Ticker
└─ IF: Is Element Hovered -> your_button_id
   ├─ IF: Is Variable Value -> hover_state:false
   │  ├─ Reset Element Animator -> your_animator_id
   │  ├─ Enable Element Animator -> your_animator_id
   │  └─ Set Variable Value -> hover_state:true
   └─ ELSE
      └─ (nothing)
└─ ELSE
   └─ IF: Is Variable Value -> hover_state:true
      ├─ Disable Element Animator -> your_animator_id
      └─ Set Variable Value -> hover_state:false

Important:

  • your_button_id = the button’s element identifier
  • your_animator_id = the animator’s identifier
  • Reset must be inside the inner IF only, so it runs once when hover starts
  • the ELSE branch is only there to turn the animator off again when hover ends

Common mistake: putting Reset Element Animator directly under the hover check, which makes it restart every tick 🫩

If you want, I can also format this as the exact FancyMenu action script tree with the right-click menu entries.

merry marsh
#

Fgured out my issue, thank you

fallen foxBOT
fallen foxBOT
#
Thread Marked as Solved

This support thread has been automatically marked as solved because there were no new messages for at least 24 hours.

The AI helper is now disabled. If you still need help, please create a new support thread.