Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HapticController.outputLevel setting while clip is not loaded raises a native java error.(Android) #33

Open
kekchpek opened this issue Aug 11, 2023 · 0 comments

Comments

@kekchpek
Copy link

Bug report

Checklist

  • [+] I'm using the latest release
  • [+] I've searched for existing issue

Environment

Apk built with Unity 2021.3.18f1
App runs on Pixel a6, Samsung Galaxy S23 and few other devices.

Goals

Set vibrations outputLevel to some value and have no errors in the log.

Steps to Reproduce

Execute next code right after application starts:

var inited = HapticController.Init();
HapticController.outputLevel = 0.2f;
Debug.Log($"Initialization result: {inited}"); // this logs true value, so initialization is successfull

Expected behavior

No errors and outputLevel set.

Observed behavior

Looks like the property is set correctly, but there is an error in log:

Error: java.lang.RuntimeException: Unable to set amplitude multiplication, no clip loaded.
java.lang.RuntimeException: Unable to set amplitude multiplication, no clip loaded.
 at com.lofelt.haptics.LofeltHaptics.setAmplitudeMultiplication(Native Method)
 at com.lofelt.haptics.LofeltHaptics.setAmplitudeMultiplication(LofeltHaptics.java:409)
 at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
 at com.unity3d.player.UnityPlayer.access$300(Unknown Source:0)
 at com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source:95)
 at android.os.Handler.dispatchMessage(Handler.java:102)
 at android.os.Looper.loopOnce(Looper.java:201)
 at android.os.Looper.loop(Looper.java:288)
 at com.unity3d.player.UnityPlayer$e.run(Unknown Source:20)

Code Samples & Details

This is not a critical issue, but if you use any crashlytics this issue makes your life a bit harder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant