OnTriggerEnter/Exit is not workin,OnTriggerEnter is not working on Oculus

Hello, I’m working with the OnTriggerEnter/Exit, and while I have the glasses connected to the glasses, my script works correctly, but once I do the build it doesn’t work, could someone help?

private void OnTriggerEnter(Collider other) {
        if(other.gameObject.isStatic==true){
            other.gameObject.GetComponent<MeshRenderer>().enabled=true;
        }
    }

    private void OnTriggerExit(Collider other) {
        if(other.gameObject.isStatic==true){
            other.gameObject.GetComponent<MeshRenderer>().enabled=false;
        },Hello, I'm working with the OnTriggerEnter/Exit, and while I have the glasses connected to the glasses, my script works correctly, but once I do the build it doesn't work, could someone help?

private void OnTriggerEnter(Collider other) {
        if(other.gameObject.isStatic==true){
            other.gameObject.GetComponent<MeshRenderer>().enabled=true;
        }
    }

    private void OnTriggerExit(Collider other) {
        if(other.gameObject.isStatic==true){
            other.gameObject.GetComponent<MeshRenderer>().enabled=false;
        }

Hello.

I had similar issues with oculus.

I could be 2 different things:

For some reason, Oculus do not run the scripts in the same order as PC (for example) if you have ScriptA and ScriptB, and both of them have a Start() function. In PC ScriptA.Start() runs before ScriptB.Start(). But in Oculus, for some reason, B runs first. And the same for all functions/scripts with same “Unity event priority”

This can cause to some variables to be null, or things like this.

to solve that. you can force the game to follow one specyfic order:

Another reason is that Oculus have lower CPU, and collisions are not calculated as often as in PC, for very fast objects, or very small objects, you can have problems.

Good luck!

Bye!