> For the complete documentation index, see [llms.txt](https://infinitypbr.gitbook.io/magic-pig-games/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://infinitypbr.gitbook.io/magic-pig-games/juicy-actions/actions/write-custom-actions.md).

# Write Custom Actions

v1.0

All <mark style="color:yellow;">Actions</mark> must inherit from `Action.cs`.&#x20;

However, we also provide a few helpful child classes that you can inherit from in order to keep consistent logic and structure. This is absolutely optional — if you're just writing an <mark style="color:yellow;">Action</mark> and you know 100% what it needs to do and that you don't need the additional structure and options, then you can easily just write an <mark style="color:yellow;">Action</mark> that inherits from `Action.cs`. Otherwise, we suggest you make use of one of the other classes.

All actions will override `ExecuteInternal()`.

| Applies an effect instantly in a single frame (no duration, no coroutine loop)                                                                  | InstantAction                      | Simplest form; executes once and completes immediately                     |
| ----------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------- | -------------------------------------------------------------------------- |
| Runs over time (lerps, tweens, movement, fades, etc.)                                                                                           | ActionOverTime                     | Provides duration handling, execution bookkeeping, restart safety          |
| Runs over time and must preserve a base/original value across restarts (ex: rotate by offset, move relative to start, scale from original size) | ActionOverTimeWithBaseValues       | Handles stable per-target base caching and restart-safe offset logic       |
| Must block the ActionExecutor until a condition, timeout, or explicit release occurs                                                            | ActionWithForceTimeUntilNextAction | Prevents the next action from starting until you release it                |
| Needs full control over execution flow and does *not* fit the above patterns                                                                    | Action                             | Lowest-level base; you manage execution, completion, and restarts yourself |

<br>
