If you’re setting the variables at the start of a level, there is the possibility of certain classes having not been initialized yet. You can check if this is what’s causing the issue by adding a small delay at the start before setting all of your variables.