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

Can't call methods in other scripts in Build

$
0
0
Everything works perfectly in the Unity Editor, but when I push to a build version, everything that involves calling methods in other scripts breaks. I've been using the method of: public GameObject goalTrackingEmpty; goalTrackingEmpty.GetComponent().orangeScores(); where goalTrackingEmpty is an empty GameObject with GoalTracking.cs attached to it. I did it this way because I didn't want to make everything static, but for some reason it's just refusing to work in the build version of the game. I checked the error logs and I see this: NullReferenceException: Object reference not set to an instance of an object at GoalTracking.orangeScores () [0x00000] in :0 at BlueGoalDetection.OnCollisionEnter2D (UnityEngine.Collision2D collision) [0x00000] in :0 (Filename: Line: -1) which doesn't really tell me much.

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>