Player
Readonly
maxReturns the absolute frequency value in Hz when 1
is specified to HapticsEffect.frequency.
The frequency setting will not be reflected in the actual vibration feedback in the following cases:
null
.Readonly
minReturns the absolute frequency value in Hz when 0
is specified to HapticsEffect.frequency.
The frequency setting will not be reflected in the actual vibration feedback in the following cases:
null
.Gets whether the device's vibration function is available.
Returns true if the device supports vibration and vibration feedback is not disabled in "Settings".
In mobile environments, vibration can be enabled or disabled with "Vibration" at "Haptic feedback" in the "Controls" tab of "Settings".
Plays vibration feedback if vibration is supported by the controller or device of the player.
In VR environments, the controllers will provide vibration feedback.
If target
is set to "left"
or "right"
, vibration feedback will be played on the corresponding left or right controller.
If target
is an unsupported value or null
, vibration feedback will be played on both controllers.
On mobile devices that support vibration, the device itself will provide vibration feedback. target
value is ignored.
If vibration is not available on the device, the call to playEffect()
will be ignored.
// Plays vibration feedback, by both controllers in VR environment, or by the device itself in mobile environment.
const effect = new HapticsEffect();
effect.frequency = 0.1;
effect.amplitude = 1;
effect.duration = 0.1;
_.hapticsHandle.playEffect(effect, null);
The content of the vibration feedback
A string value indicating the target to vibrate ("left"
or "right"
), or null
for unspecified
Generated using TypeDoc
The handle to control vibration of the controllers or devices of the player. You can access the handle with PlayerScript.hapticsHandle.