State Toggle

< Back to mechanic page

Description

Toggle a state on the model. In other words, if the model has an animation, it will remove it. Otherwise, it will be added.

Attributes

Attribute Aliases Description Type Default
modelid m, mid, model Targeted model String
state s Targeted state String
speed sp Speed multiplier of the state Double 1
lerpin li Transition tick when the animation starts Integer 0
lerpout lo Transition tick when the animation ends Integer 0
force f Should the animation be played again even if it is already playing Boolean true
ignorelerp i Should the state be instantly removed without transition Boolean false
priority p, pr Target the animation of a particular priority
Only parsed when model is using new animation system
Integer 1

Examples

In this example, we will assume the model is something akin to a machine that can be turned on or off, playing different animations based on that. We can achieve this simply with the following:

  Skills:
  - StateToggle{mid=ExampleModel;state=activated} @self ~onInteract

And then interacting with the model will either play or stop the "activated" animation, depending on the previous state

Aliases

  • togglestate
Updated Aug 19, 2026