UPDATE : Found what is the line that is causing the issue (updated example).
Still no idea how to fix it…
So I’m executing this function on Update()
var pickUpObjectsInSightList = new List.<Transform>(); //Contains a list of all the objects the current actor can see.
function PickUpObjectsInSight (){
for(var pickUpObject : Transform in objManager.pickUpObjectList){
var objectCenter : Vector3;
objectCenter = pickUpObject.renderer.bounds.center;
}
}
Now when I’m in the editor everything works fine but, when I do a build I start to get errors on the log that change the behaviour. I can’t figure out what the problem is. It’s my first time actually learning about the output_log…
NullReferenceException
at (wrapper managed-to-native) UnityEngine.Transform:INTERNAL_get_position (UnityEngine.Vector3&)
at UnityEngine.Transform.get_position () [0x00000] in <filename unknown>:0
at Player_Properties.PickUpObjectsInSight () [0x00000] in <filename unknown>:0
at Script_Wife.Update () [0x00000] in <filename unknown>:0
(Filename: Line: -1)
Any help very appreciated!