var player : Transform;
var finish : Transform;
var dist : float;
function Update(){
dist = Vector3(player.position, finish.position);
}
This simple code is really holding up my game. I need to know the distance from player to finish line. This code works great in Unity, and Unity Remote but when i build and run its always 26000…any reason? Thank You for any help.
I know this is changing the topic here but was wondering if you could help me with another problem I’ve been having. When First loading a scene on android everything runs great but then I get to a new object and it stutters a bit then resumes running fine again. Is there a way to front load all of that stuff to process during level loading. Ex space ship game runs fine until i hit throttle then fire starts and stutters then runs fine even with the fire there. Thanks dont know how good this explaination was but thanks for anything.
yeah I noticed that as well the first time you instantiate some new object. I don’t really know if there is a way to improve that. Try to do one thing. When the scene loads put the object you instantiate somewhere you can’t see it and destroy it in its Start() phase. It might be that the engine allocates that object in the memory in advance, so the next time you try to instantiate that it should be smooth and fast, but this is just a guess, haven’t tried myself.