Background for Fallout 4
Member of the Utility script
floatfunctionRandomFloat(floatafMin=0.0, floatafMax=1.0)NativeGlobal

Description

Wiki Description

Generates a random floating point number between the minimum and maximum values (inclusive).

Documentation Comment

Generates a random floating point number between afMin and afMax (inclusive)


Caveats


Parameters

floatafMin=0.0

CK Wiki Description

The minimum value for the random floating point number.

floatafMax=1.0

CK Wiki Description

The maximum value for the random floating point number.


Examples

; Get a random number between 0 and 1
float random = Utility.RandomFloat()
; Get a random number between -1 and 1
float random = Utility.RandomFloat(-1.0, 1.0)

Auto-Generated Example

float myFloat__afMin
float myFloat__afMax

float returnedValue = Utility.RandomFloat(myFloat__afMin, myFloat__afMax)

Related Pages


Additional References

View this function’s page on the Fallout 4 Creation Kit Wiki

Some data provided by the Fallout 4 Creation Kit Wiki. Licensed under the Creative Commons Attribution-Share Alike 4.0 license.