accept what you can't change


The bug that forced the scene to reload was caused by the error

Failed to create agent because there is no valid NavMesh. 

Since there was a NavMesh in the scenes, I experimented a little with the Player’s foot collider and attached a NavMeshModifier script with the mode “Remove object” so that the Player wasn’t attached to the NavMesh in the moment of its initialization. One of this solved it and you know what they say - never change a working system.


I wasn’t able to fix the bug that sometimes you have sound (and are able to change the master volume), and sometimes you don’t. The last time I hit Build and Run everything worked fine. After I uploaded the build, it didn’t because this error occurs

Uncaught TypeError: Cannot read properties of undefined (reading 'length')
at AudioProcessor.process (1341c6cc-8c86-4e8b-8cce-ecfa593f1989:1:688)
process @ 1341c6cc-8c86-4e8b-8cce-ecfa593f1989:1

with a reference to the last line of this code section:

process(inputs, outputs, parameters) {
        const output = outputs[0];
        if (this.payload[this.bufferFlag]) {
            if (this.bufferIndex === 0) {
                this.port.postMessage(this.bufferSize);
            }
            const bufferSliceEnd = this.bufferSize / output[0].length;

Since audio was blocked before because of the browser’s autoplay policy (AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://goo.gl/7K7WLu) I added the code of this https://alessandrofama.com/tutorials/fmod/unity/fix-blocked-audio-browsers thread to an overlay and tried to have everything loaded after an user interaction. As I said - it worked in the build before I uploaded its .zip file, so I think I simply can’t fix this and I’m ready to let it go.


I couldn’t find out why the music and SFX volumes couldn’t be changed with any of the approaches I tried, but the master volume could. I guess it is easier to understand FMOD if you have the program itself and are not only working with the files in the Unity asset folder. I didn’t know anything about FMOD before and currently I’m not really convinced that the effort required to use and integrate it offers any advantage over just adding sound files and writing a script to play them randomly. Maybe it would have been better to remove it from the project earlier to get an application that’s working properly. Lesson learned(?)

Files

PUNisher_1.2_fixed.zip 21 MB
Feb 05, 2024

Get PUN-JO

Leave a comment

Log in with itch.io to leave a comment.