Scriptable Item allows you to script the behavior of an item.
|Source Code Asset||An asset can specify the script content that represents the item’s behavior.|
|Source Code||You can directly specify the contents of the script that represents the behavior of the item.|
Source Code Asset or
Source Code. If both are specified, the content of
Source Code Asset takes precedence.
Also, the script length is limited to a maximum of 20KB.
Each item can have at most one Scriptable Item component. It can also coexist with components for other types of items.
See Script Reference for APIs that can be used in scripts.
- Scriptable Items don’t work in world preview
- Internal state including script variables are reinitialized periodically
$.stateto persist variable changes