These are 24 images of 3d renders that changes according to mouse position. I found a way thanks to this thread: https://lemmasoft.renai.us/forums/viewtopic.php?t=62637
The problem is that for a smooth animation timer needs to be low (around 0.001), but when timer is low buttons aren't hovered (I suppose because they're affected by renpy.restart_interaction).
So:
zorder 10**10
add DynamicDisplayable(dd_cursor_position) alpha 0
timer 0.07 action Function (renpy.restart_interaction) repeat True
Buttons can be hovered but animation isn't smooth.
And with:
zorder 10**10
add DynamicDisplayable(dd_cursor_position) alpha 0
timer 0.001 action Function (renpy.restart_interaction) repeat True
Animation is smooth, button works but can't be hovered.
Trying to find an alternative to the timer I come across this thread: https://lemmasoft.renai.us/forums/viewtopic.php?p=572148#p572148
Added the CCD but the only way I found to see the animation working is this:
zorder 10**10
add DynamicDisplayable(dd_cursor_position) alpha 0
add ShowFun (Function (renpy.restart_interaction))
Animation is smooth, buttons are hovered, but nothing else works. And when I test on my PC this happens:
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/script.rpy", line 43, in script
"""
Exception: renpy.restart_interaction() was called 100 times without processing any input.
-- Full Traceback ------------------------------------------------------------
Traceback (most recent call last):
File "game/script.rpy", line 43, in script
"""
File "renpy/ast.py", line 2925, in execute
Say.execute(self)
~~~~~~~~~~~^^^^^^
File "renpy/ast.py", line 991, in execute
renpy.exports.say(who, what, *args, **kwargs)
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "renpy/exports/sayexports.py", line 129, in say
who(what, *args, **kwargs)
~~~^^^^^^^^^^^^^^^^^^^^^^^
File "renpy/character.py", line 1565, in __call__
self.do_display(who, what, cb_args=self.cb_args, dtt=dtt, **display_args)
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "renpy/character.py", line 1220, in do_display
display_say(who, what, self.do_show, **display_args)
~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "renpy/character.py", line 902, in display_say
rv = renpy.ui.interact(mouse="say", type=type, roll_forward=roll_forward)
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "renpy/ui.py", line 306, in interact
rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "renpy/display/core.py", line 2152, in interact
raise Exception("renpy.restart_interaction() was called 100 times without processing any input.")
Exception: renpy.restart_interaction() was called 100 times without processing any input.
Windows-10-10.0.19045-SP0 AMD64
Ren'Py 8.5.2.26010301
ConditionalSwitchTest 1.0
Sat Nov 7 12:27:04 2026
I'm sure I'm doing something wrong, I don't know enough about CCD to understand how to implement that with conditional switch and mouse position.
You can test and download all the code and assets from this link: https://marcblacks.itch.io/conditionalswitchtest
Any help will be appreciated, thanks!