Vizard 7 » Command Index » Vizard modules » vizact » <vizact>.randfloat
7.6

<vizact>.randfloat

Create a dynamic parameter that will randomly generate a floating point number

<vizact>.randfloat(  
min  
max  
)  
min
The minimum value
max
The maximum value

Remarks

Dynamic parameters allow you to control the input of an action every time it is performed. This dynamic paramter will randomly generate a floating point number between the given min and max values.

Return Value

A dynamic parameter that can be passed to any function that generates actions.

Example

#Create a dynamic paramter that will generate a floating point number between 0.1 and 0.5
TimePeriod = vizact.randfloat(0.1,0.5)

#Create an action to wait for the amount of time generated by the dynamic parameter
WaitTime = vizact.waittime(TimePeriod)

#Create an action to toggle the visiblity of an object
ToggleVisible = vizact.method.visible(viz.TOGGLE)

#Create an action that will randomly toggle the visibility of an object
Flash = vizact.sequence(WaitTime,ToggleVisible,viz.FOREVER)

object.addAction(Flash)

See also

<vizact>.choice
<vizact>.randint