ShakeController - Game
Jump to navigation
Jump to search
Member of: Game Script
Shakes the controller with the specified strength, for the specified length of time.
Syntax[edit | edit source]
Function ShakeController(float afSmallMotorStrength, float afBigMotorStreangth, float afDuration) native global
Parameters[edit | edit source]
- afSmallMotorStrength: The strength of the motor with the smaller weight. Clamped from 0 to 1.
- afBigMotorStreangth: The strength of the motor with the larger weight. Clamped from 0 to 1.
- afDuration: How long to shake the controller - in seconds.
Return Value[edit | edit source]
None.
Examples[edit | edit source]
; Shake the controller for 2 seconds
Game.ShakeController(0.5, 0.5, 2.0)
Notes[edit | edit source]
The locations of the small and large haptic motors on a controller vary by model. Previous versions of this documentation used the alternative parameter names afLeftStrength and afRightStrength, possibly implying that the game hardcoded the left and right motors. Testing may be in order.