- Home /
Question by
SickTrickz832 · Jul 08, 2020 at 03:29 PM ·
c#scripting problembuild-error
Why is this variable not setting in build?
So I instantiate a bomb object from a spawner, and after it is instantiated it sets one of the bombs variables to a number to turn on the corresponding perimeter object around it. In the game view in Unity it works perfectly, but in build it does not. Why is this variable not setting?
When i get the spawner to set the variable to the bomb when it is instantiated like this, it doesn't work whatsoever. When I get the instantiated bomb to go to the spawner script to set it, it works in game view but not build. For some reason it will not update it
In the spawner:
spawnPointIndex = Random.Range(0, spawnPoints.Length); //Chooses a spawn point at random to spawn bomb at
Debug.Log(spawnPoints[spawnPointIndex].name);
Instantiate(bomb, spawnPoints[spawnPointIndex].position, spawnPoints[spawnPointIndex].rotation);
bE.perimToEnable = spawnPointIndex;
bombproblem.jpg
(257.6 kB)
Comment
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Vuforia needs to be played before the build works 0 Answers
unity load an player made C# script 2 Answers