unity3d - C# frames running twice? -
this has me utterly confused. using unity3d , c# scripts , seems if code running twice per frame. on button down have sprite change position , changes once @ least think does. i added debug in , getting results this: score 1 @ 3.569991 @ frame 168 score 2 @ 3.57414 @ frame 168 score 3 @ 3.818392 @ frame 183 score 4 @ 3.820178 @ frame 183 and forth carrying on. not updating score in other scripts. there more script printing score out on screen. is there reason why script may run this? full script: using unityengine; using system.collections; public class score : monobehaviour { public static int highscore; public static int myscore; public static bool allowscore; public guitext mytext; public static bool whichscene; //only allows score start when first object has passed player object void ontriggerenter2d(collider2d collisionobject) { allowscore = true; debug.log ("allowscore true"); } void ...