How can I see wich script changed a certain variable ?

How can I see wich script changed a certain variable ?
I’m working on a big project with +30 scripts of +400 lines so it’s pretty hard so see it by myself…

My current problem is that my player is always warping to 0x0y0z after spawn, but i don’t find wich script is changing his position :confused:

You have a few options here, one is to right click the variable in Visual Studio and click “Find all references” that will list every bit of code that references that variable, you can then scan through to find the places where the value is set or modified. If you’re not using VS then most other IDEs will still have a similar feature to locate references.

Alternatively you could swap your variable out for a property, and in the setter have a check for the zero values, if detected you can log out a call stack or just stick a break point in there, that will let you know exactly where and when it gets set to the zero value, you can then fix the issue, and repeat until nothing is setting it to zero NOTE: depending on your code and how the zero value is being set this may not catch all cases where a zero value could be set, but you could test enough to be confident, and combine this with checking your variable access.