Installation
Installing Godot Stat Math addon in your Godot 4 project.
Prerequisites
Godot 4.0 or higher
Basic understanding of GDScript
Installation Methods
Asset Library (Recommended)
Open Godot Editor
Go to Project → Project Settings → Plugins
Search for “Godot Stat Math” in the Asset Library
Click Download and Install
Enable the plugin in the Plugins tab
Manual Installation
Download the latest release from the GitHub repository
Extract the contents to your project’s
addons/
folderThe structure should look like:
addons/godot-stat-math/
In Godot Editor, go to Project → Project Settings → Plugins
Find “Godot Stat Math” and enable it
Git Submodule (For Developers)
git submodule add https://github.com/edzillion/godot-stat-math.git addons/godot-stat-math
Verification
After installation, verify the addon is working:
func _ready():
# Test that StatMath is available
var random_normal = StatMath.Distributions.randf_normal(0.0, 1.0)
print("Random normal value: ", random_normal)
# Test basic statistics
var data = [1.0, 2.0, 3.0, 4.0, 5.0]
var mean_val = StatMath.BasicStats.mean(data)
print("Mean of [1,2,3,4,5]: ", mean_val) # Should print 3.0
Configuration
Optional: Set Global Seed
For reproducible results across your entire project, add this to your project.godot
file:
[application]
config/name="Your Game"
godot_stat_math_seed=12345
This ensures all StatMath functions use the same seed for consistent results.
Troubleshooting
Plugin Not Appearing
Ensure the folder structure is correct:
addons/godot-stat-math/plugin.cfg
should existRefresh the project (Project → Reload Current Project)
Check that you’re using Godot 4.0 or higher
StatMath Not Available
Verify the plugin is enabled in Project Settings → Plugins
Make sure you’re not trying to use StatMath in
_init()
- use_ready()
insteadCheck the console for any error messages
Getting Help
Check the GitHub Issues
Review the examples in the
addons/godot-stat-math/examples/
folder