The most important part of every game are Scripts. Creating chunks of code that handle game events, respond to user input, and control objects is an essential ingredient in all games. In short, scripts make games interactive by adding gameplay. It applies to both small and huge production. This documentation section covers the most important parts of the scripting pipeline and helps with starting the game scripting.
You can write scripts in C# and add them to scene objects. To learn more about it see the pages in this section. If you need help with learning C# see this page.
[!Note] Explaining C# and vector math is out of the scope of this documentation.
Flax uses Mono to load, compile and execute C# scripts. Currently the newest C# 7.2 version is fully supported (uses .Net 4.5).
In this section
- Create and use a script
- Script properties and fields
- Script events
- Accessing scene objects
- Creating and destroying objects
- Scripts debugging
- Visual Studio
- Scripts serialization
- Empty Actor
- Custom Editors
- Custom script editor
- Preprocessor variables
- Scripting restrictions
- Plugins Window
- Plugin Exporting
- How to create a custom editor
- How to create a custom editor window
- How to create a custom editor plugin
- How to create a custom asset type
- How to change scene from script
- How to use custom settings
- How to import asset from code