<vizjoy>.rumble

Create rumble effect for joysticks

 

<vizjoy>.rumble(
    force    
    duration    

)

 

force

Length of force vector


duration

Duration in seconds


Remarks

This command will create a rumble action that can be applied to any joystick which supports Force Feedback. The rumble effect lasts for the specified duration. The effect will pick a random direction every frame and apply a force in that direction. The length of the force vector is specified by the user.

Return Value

Rumble action

Example

#Create rumble action with force 0.4
rumble = vizjoy.rumble(0.4)

#Add rumble action when button 1 is pressed
def joybutton(e):
    if e.button == 1:
        e.joy.addAction(rumble)

viz.callback(vizjoy.BUTTONDOWN_EVENT,joybutton)