<!-- Page: https://rustic-game-engine.pages.dev/docs/guides/gameplay-actions/value-keyframes -->

# Animate script value keyframes

[Back to Use gameplay actions](https://rustic-game-engine.pages.dev/markdown/guides/gameplay-actions.md).

`Animation.value(keys, onUpdate)` runs numeric/vector/quaternion keyframes for
script or UI state; its callback receives an ordinary value. Keys start at zero
and have strictly increasing times. The starting key's easing controls its span.
The following example changes a script value from zero to one and back:

Follow [Set up gameplay actions](https://rustic-game-engine.pages.dev/markdown/guides/gameplay-actions/setup.md) before running this Lua example.

```lua
return { Start = function()
  Animation.value({
    {time=0, value=0, easing=Ease.OutQuad},
    {time=1, value=1, easing=Ease.InQuad},
    {time=2, value=0},
  }, function(value) print(value) end)
end }
```
