The math.noise() function has an undocumented maximum input value that causes it to return 0 for all inputs above this threshold. This has caught me out multiple times.
Findings:
- Maximum safe input I’ve found: 262,104
- Inputs >= 262,144 (2^18): Begin degrading, with only 94% of sampled values producing non-zero results
- Inputs >= 4,194,304 (2^22): Always return 0
- Partial degradation: Between 2^18 and 2^22, the function progressively loses precision
This limitation affects common use cases:
math.noise(tick())always returns 0 becausetick()returns values ~1.7 billion- Large coordinate systems (e.g., procedurally generated worlds) may have regions where noise fails
- Time-based animations using
tick()directly will not work
It’d be good if you could update the docs to:
- Highlight what the safe range for inputs are (and confirm)
- Provide examples of safe usage patterns:
math.noise(tick() % 262104)for time-based noisemath.noise(tick() * 0.0001)for scaled time-based noise- Coordinate clamping or scaling for large spatial systems
Testing Method (using Assistant):
Tested with fractional offsets (0.01 to 0.99) at various magnitudes. Results show 98% non-zero at 2^10 through 2^18, degrading to 94% at 2^18, and 0% at 2^22 and above.
Affected URL: https://create.roblox.com/docs/reference/engine/libraries/math#noise