/godot-animation-reverser

Reverses the currently playing animation

Primary LanguageGDScriptMIT LicenseMIT

Table of Contents

  1. Setup
  2. Reverse an animation

Setup

  1. Copy the addons folder into your project
  2. Go to Project Settings -> Plugins
  3. Enable the addons

Reverse an animation

  1. Open your animation player
  2. Set the current animation (choose in inspector)

Screenshot 2022-02-09 at 16 50 56

  1. Click Project Settings -> Tools -> Reverse animation

Screenshot 2022-02-09 at 16 49 51

  1. The animation will then be duplicated, reversed and saved under "{original name}-reversed"

Screenshot 2022-02-09 at 16 51 38

Buy Me A Coffee

Helper utilities

Autonaming

If you have backwards or forwards in your animation name, they will be automatically reversed.

I.e. an animation name of run-forwards will be reversed and the new animation will be named run-backwards. I.e. an animation name of run-backwards will be reversed and the new animation will be named run-forwards.

If neither of these are found in your animation name, -reversed will be appended to the original name.

Calling from code

The code is pretty performant and can be called in your _ready function if you need to.

On my machine (Mac OSX) reversing an animation takes around 4 ms

You can call the static function helper.reverse(animation_player, anim_name: String, new_name: String) to reverse any animation in your animation player

You can call the static function helper.reverse_current(animation_player, new_name: String) to reverse the current animation