|
Hello, Basically i'm trying to make a Zombie attack my "player" but only when the "player" is in a certain range. I've taken some code from this website (seen here.) . However, i have been getting the following error: ArgumentException: get_time can only be called from the main thread. Constructors and field initializers will be executed from the loading thread when loading a scene. Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function. Zombie Attack..ctor () (at Assets/3rd Person Script/AIScripts/Zombie Attack.js:10) Here is the code:
How do i get rid of this error and make the Zombie follow the "player" within a certain range? Many thanks.
(comments are locked)
|
|
Code outside of functions should stick to declaring types or specific values only. Instead of
use Seems that got rid of that error but popped up a new one: "NullReferenceException Zombie Attack.Start () (at Assets/3rd Person Script/AIScripts/Zombie Attack.js:21)" Also thank you for the fast reply!
Nov 22 '10 at 11:10 PM
ImpactUK
(comments are locked)
|
