You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An Android application which implements a vibration feature.
Describe the problem or limitation you are having in your project
On Android, Input.vibrate_handheld uses DEFAULT_AMPLITUDE to vibrate, which can be very strong.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
An additional parameter to Input.vibrate_handheld could be added so that amplitude is also controllable. As per the documentation, createOneShot, which Godot uses to implement vibrate_handheld, accepts two parameters, a duration in milliseconds and an integer amplitude between 1 and 255, of which only the duration is currently exposed. DEFAULT_AMPLITUDE (currently used by Godot) is defined as -1 in the spec.
On IOS, I believe a parameter called HapticIntensity can be added to the HapticPattern used by Godot. Possible values range from 0 to 1 as per this document, which I consider more elegant than Android's 8 bit range, and could be used by Godot as well.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
The function would be called like this: Input.vibrate_handheld(int duration_ms=500, float amplitude=1.0).
If this enhancement will not be used often, can it be worked around with a few lines of script?
No. The only workaround is building a separate plugin with the included functionality.
Is there a reason why this should be core and not an add-on in the asset library?
Everything is already pretty much there, the function only misses an additional parameter.
The text was updated successfully, but these errors were encountered:
Describe the project you are working on
An Android application which implements a vibration feature.
Describe the problem or limitation you are having in your project
On Android,
Input.vibrate_handheld
uses DEFAULT_AMPLITUDE to vibrate, which can be very strong.Describe the feature / enhancement and how it helps to overcome the problem or limitation
An additional parameter to
Input.vibrate_handheld
could be added so that amplitude is also controllable. As per the documentation,createOneShot
, which Godot uses to implementvibrate_handheld
, accepts two parameters, a duration in milliseconds and an integer amplitude between 1 and 255, of which only the duration is currently exposed.DEFAULT_AMPLITUDE
(currently used by Godot) is defined as -1 in the spec.On IOS, I believe a parameter called
HapticIntensity
can be added to the HapticPattern used by Godot. Possible values range from 0 to 1 as per this document, which I consider more elegant than Android's 8 bit range, and could be used by Godot as well.Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
The function would be called like this:
Input.vibrate_handheld(int duration_ms=500, float amplitude=1.0)
.If this enhancement will not be used often, can it be worked around with a few lines of script?
No. The only workaround is building a separate plugin with the included functionality.
Is there a reason why this should be core and not an add-on in the asset library?
Everything is already pretty much there, the function only misses an additional parameter.
The text was updated successfully, but these errors were encountered: