02-04-2023 05:16 AM
Hi, I've a simple bug to report
I can't seem to find a way to report bugs regarding Oculus Integrations package for Unity so I report it here:
The script AudioTrigger from the package contains this line of code
which sets the UnityEngine.Random seed to (int)Time.time value
So, this means that the UnityEngine.Random seed is overriden by that script on AudioTrigger initialisation. If Oculus stuff is active in the scene on Startup (usually it is), then the random seed value will be overriden by that line on Start, always with value of 0, resulting in our app UnityEngine.Random calls always returning same values.
Usually developers set the seed themselves or leave it up to UnityEngine to set (it's set earlier than when the AudioTrigger script does it), but because this line exists, it is very likely that this seed value will be overriden with 0 (or with time in second afer Oculus stuff is initialised in the scene, if you activate Oculus stuff after let's say one second, then the seed will be 1).
Such thing shouldn't occur. Tool developers should leave the random seed initialisation up to app developers or to the UnityEngine.
To fix this - simply removing that line from upcoming releases will fix the problem, then the seed will be randomly applied by the engine on app startup or by the app developers if they have their own seed initialisation.
Regards to Oculus tools developers.
Did this answer your question? If it didn’t, use our search to find other topics or create your own and other members of the community will help out.
If you need an agent to help with your Meta device, please contact our store support team here.
Having trouble with a Facebook or Instagram account? The best place to go for help with those accounts is the Facebook Help Center or the Instagram Help Center. This community can't help with those accounts.
Check out some popular posts here:
Getting Help from the Meta Quest Community
Tips and Tricks: Charging your Meta Quest Headset