Zombunny not properly responding
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. 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".
did you bake a navmesh? any errors present in console?
Thank you so much for trying to help.
I baked the navmesh and the only message I received that seemed questionable is:
!NullReferenceException: Object reference not set to an instance of an object
But Im not certain this error appeared after or before the baking. I have since rebaked the navmesh, making overly certain that the settings in navigation before baking were what the tutorial called for but something is still not quite right.
Another note is that I am using the latest version of Unity and this tut is nearly two years old so some of the inspector settings arent in the same place (i.e. width and height accuracy settings)
It should work, there's not that many things that can go wrong here. Is the ground plane set to static? Are there multiple GameObjects tagged as player? Does that null ref exception show up if you clear console and then start play?
Thank you so much for that. This will help me tremendously moving forward... So the console shows the error every time the zombunny tries to move (that is to say, when the navmesh tries to move if im understanding this correctly as there are no physics being applied to the bunny itself) that error is definitely the problem. I have set the player tag to "Player" and I have left the bunny untagged. The environment is untagged as well and static.
The console error reads: !NullReferenceException: Object reference not set to an instance of an object CompleteProject.Enemy$$anonymous$$ovement.Update () (at Assets/_CompletedAssets/Scripts/Enemy/Enemy$$anonymous$$oveent.cs.27)
Does zombunny have a Nav$$anonymous$$eshAgent component? $$anonymous$$issing the component would cause that error.
Answer by abhijeetjain04 · Aug 31, 2017 at 05:30 AM
For everyone who has this issue: "The enemy go towards the 0,0,0 point, then stops and do anything else.
That's because there's an issue with the FindGameObjectWithTag function. Try using GameObject.Find instead.
Its on YouTube video page, comments section. Thanks Pablo Dusi.
Your answer
 
             Follow this Question
Related Questions
I have starded the basic tutorial and got this bug. Cannot move further because of this. 0 Answers
UnassignedReferenceException: The variable agent of PlayerMovement has not been assigned 0 Answers
RogueLike 2D Tutorial Help 0 Answers
I need help with learning... 1 Answer
Can i move the camera\character in a VR game with my keyboard & mouse? 0 Answers