|
hello there, i have three objects (all exactly the same except the texture); they all have a script on them that measures the distance to the player and displays a gui texture when the player is near. now all 3 scripts are exactly the same, but one of them works and the others don't. i even copied the working one into the other two - still, they won't do anything. working code: not working code: the second code does not update the dist1 variable & the Debug Log from the update function does not return, so it has to be somewhere there (i think). if i try to return the value of dist1 later in the code it's '0'. anyway, i'm running out of ideas. is it maybe not possible to do three different distance checks at the same time? should the distance check be on the player rather than the 3 objects?
(comments are locked)
|
|
Looks to me like the Update function in the second case is not being called. Are you sure the object this is on is enabled? Try Debug.Log("Update"); as the first line in the Update function as a baseline check. i feel very stupid now. yes, the object was enabled, but the script wasn't >.< so sorry for asking silly questions... but thank you very much for your help!
Jul 26 '11 at 01:53 PM
LeeGibson
No problem, glad I could help. :)
Jul 26 '11 at 02:02 PM
almo
(comments are locked)
|
