Create a simple animation forward one direction?

Hello, Kustom community!
I’m trying to create a simple animation in KLWP for a refresh icon.
I want the animation to:

Play only once when I tap the icon.

Not reverse direction (always animate forward, e.g., clockwise rotation).

Automatically reset after playing, so that the very next single tap will trigger the animation again from the beginning (in the same direction).

Essentially, I need a reliable way to make a single tap start a one-time animation, and then have it ready for the next single tap without requiring any “reset” or “second tap” from the user.
Is this achievable in KLWP, and if so, what’s the recommended approach?

Hi there,

Try these steps (see the animated GIF below).

Rotate • KLWP Animation 250608-001

STEPS

  1. Create a global variable:
    • Title: any_name ➞ i.e. refresh
    • Type: On/Off Switch
    • Auto On: Manual
    • Auto Off: Manual and Timer
    • Seconds: 1
  2. Add a touch action to any object you want:
    • Action: Toggle Global Switch
    • Switch: choose the global variable ➞ refresh
  3. Add an animation to the same object
    • ReactOn: Formula
    • Formula: $if(gv(refresh),f,r)$
    • Action: Rotate

I hope this would help.
:smiling_face::+1:

Great!!! Thank you very much!!!:folded_hands::+1: