Code only runs in playmode, except for some pcs... is unity holding a grudge?

Hey, recently I made a game and when I make the build a crucial part of the code doesnt run on the build, after figuring that it was probably some colliders that had negative size I remade the build but it only works on pcs that hadn’t run the build with the negative colliders yet.

My question is, does unity store a cache a dll, something really, and where can I delete it? I delete everything in the folder before building
Am I missing something, why does a piece of code only work on fresh pcs?

This function is called on callback after a scene is done loading, the code that doesnt run in build is the one underlined.

Level script

public class Level : MonoBehaviour
{
    [SerializeField] private Transform _spawnTransform;

    public Vector3 GetSpawnPosition()
    {
        return _spawnTransform.position;
    }
}

heres the full script and also the player controller
https://paste.ofcode.org/yRXWFaWb5k8pZGq7CRuvPa

Start with the runtime / device logs, just like any other bug.

If your code has a dependency on execution order this can happen. There’s many other ways it can happen too, eg “runs fine on these PCs, crashes on theses.”

And that means… time to start debugging!

By debugging you can find out exactly what your program is doing so you can fix it.

Use the above techniques to get the information you need in order to reason about what the problem is.

You can also use Debug.Log(...); statements to find out if any of your code is even running. Don’t assume it is.

Once you understand what the problem is, you may begin to reason about a solution to the problem.

I have debugged even going as to attach the debugger to a development build everything is fine, it works on pcs that haven’t had a prior build.
The build doesnt crash its just a simple line that gets skipped, or so I tought, the debugger still catches the line and everything seems fine just the logic of the code doesn’t happen

If you have a code issue, please post your code. The code may just blurt out “of course that won’t work!” to someone who has already had a similar experience. If not that, at least it would provide an opportunity to ask “Did you try this? And that?”.

Sure I can edit the post and put the code in, but that’s not the point of this post.
I made a question and that’s what I want asked not help with my project in specific

My question is, does unity store a cache a dll, something really, and where can I delete it? I delete everything in the folder before building

Specifics matter. That’s why we ask for code. For instance, if you have a variable:

private int foo;

and in code you set it and it’s not working, there is a WORLD of difference if your code is:

foo = 0;

and

int foo = 0; // you just declared a local variable unrelated to your variable above!

That is only one tiny example of the ten BILLION ways that one character can have unbelievably complex interactions and consequences.

Unity is an app that does a LOT of things… a LOT!

The things that Unity does that affect YOU need to be reasoned about, not talked about around the water cooler.

Debugging is what we use to reason about what your code is doing.

Sure I uploaded the code, just wanted that question asnwered because everyone I show the code can never solve it so I gave up on asking for code solutions and just wanted a simple question answered, a yes or no, which you still haven’t gave an answer to

Did you run the previous (non working) build on your development computer? Does the new fresh build works on your development computer?

If yes to both questions, you just forgot to transfert the new build on the other computers :stuck_out_tongue_winking_eye:

(I never heard about a persistant cache related to physics.)