Script seems inactive?
Not the best use of a question mark there but it seemed appropriate when I typed it...
Ok so in short, I am working through the Survival Shooter Tutorial. When I apply the EnemyMovement Script to the Zombunny, the lil guy walks a few steps then hits an unseen obstacle and just loops his movement animation in place. When I reference the inspector of the bunny, the applied EnemyMovement script is greyed out... does this mean it is inactive for some reason? Or perhaps someone has hit the same problem when cruzin through the tut?
Thanks so much for everyone's time!
PS I have ensured that my Player game object has been tagged as "Player".
Answer by KenjiKyo · Jul 18, 2016 at 05:32 PM
This field simply shows the reference to the script used by the component attached to the gameobject, in your case "EnemyMovement.cs" attached to Zombunny. The reference is grayed out because it cannot be edited as it is automatically obtained from the attached script, but it is active. To make it inactive, you would have to uncheck the box right next to the C# icon.
You can easily see that the script is active by putting a simple line of code like so :
void Update()
{
Debug.Log("Enabled!");
}
As soon as the game is running, you will see that the line "Enabled!" will continuously be displayed in the console window because the script is active. Then, if you tick off the box of the attached script, the messages will stop to be written because it becomes inactive.
Answer by RedDjinnPro · Jul 18, 2016 at 06:00 PM
@kenjiKyo Wow. Couldnt ask for a better answer. Thank you so much. At least I know then my problem is elsewhere. Really appreciate this.
Your answer
Follow this Question
Related Questions
The roll a ball script isn't working 3 Answers
After watching tutorials, should I start a project from scratch? 1 Answer
Multiple in game currencies 1 Answer
Using LookAt to look at a Vector3 not Transform 0 Answers
How to make a shooting bow? 0 Answers