Quantcast
Channel: Questions in topic: "build"
Viewing all articles
Browse latest Browse all 4084

Can't access other game object in build-ed version of the game but when testing in editor it works alright

$
0
0
So I have start button with code: GameControlScr gameControlScr; void Start () { gameControlScr = GameObject.Find ("GameControl").GetComponent(); } void OnMouseDown() { gameControlScr.testMethod(); } When I test it from unity editor it works fine. It calls testMethod() and new scene is loaded. But when I build project into android or pc versions it won't call this method. It seems like it can't access gameControlScr. I also tried making gameControlSrc a static reference and it won't work as well. Btw testMethod() just have this line of code: public void testMethod(){ Application.LoadLevel("Test01Level01"); }

Viewing all articles
Browse latest Browse all 4084

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>