- Home /
Survival Shooter Tutorial fix for Unity 5
Hi, I'm trying to do the Survival Shooter tutorial which requires me to download the assets. I understand that the assets are for unity 4.6, so while importing I was asked to update the files to unity 5, so I did.
I then tried running the saved level to see if everything was working, and for the most part it was. I can move, shoot and the sound works but no enemies spawn, they do show up in the hierarchy but not in the scene. I get this warning when playing,
"Failed to create agent because there is no valid NavMesh UnityEngine.Object:Instantiate(Object, Vector3, Quaternion) CompleteProject.EnemyManager:Spawn() (at Assets/_CompletedAssets/Scripts/Managers/EnemyManager.cs:33)"
I also get this error ""SetDestination" can only be called on an active agent that has been placed on a NavMesh. UnityEngine.NavMeshAgent:SetDestination(Vector3) CompleteProject.EnemyMovement:Update() (at Assets/_CompletedAssets/Scripts/Enemy/EnemyMovement.cs:30)"
So the problem is obviously the NavMesh but I don't know how to fix this?
Thanks in advance.
Hi.
I'm actually trying to fix the same issues... I don't find help anywhere so it could be great to have someone who knows what the problem is to help...
Thanks.
Answer by sonicviz · Mar 11, 2015 at 01:42 PM
"The Survival Shooter was again made in Unity 4 however we are working on a Unity 5 version and hope to have this ready soon. This will either replace or join the current version on the Asset Store."
http://forum.unity3d.com/threads/sample-project-errors-with-unity-5.308784/#post-2010285
Answer by PsychoRealm · Mar 12, 2015 at 05:51 AM
Hi there!
I found where the problem was coming from. I just had to re-bake my NavMesh for the scene and you should be good to go! Hope that might help you
See ya!
I did that and it didn't work. The enemies still get all locked up in the doorway even after re-baking the Nav$$anonymous$$esh. Going by the above link @ http://forum.unity3d.com/threads/sample-project-errors-with-unity-5.308784/#post-2010285 it appears to be mesh collider related?
PsycoRealm how did you done that? I'm a newbie trying to do this.
Answer by derekda · Aug 04, 2015 at 02:44 PM
I had the same problem, but then realized had left the Game in Play mode while creating all the parts for the Bake. When I did them again not in Play mode, it worked
Answer by Kelvin3d · Aug 18, 2016 at 02:02 PM
Hey guys,
For the Navigation, I guess that we have missed sth. Before clicking the "bake" button, we should choose the environment in Hierarchy first. Otherwise, Unity doesn't know what you want to brake at all. Thus, the enemy is locked up aat doorway. If you choose environment in hierarchy, the rebrake. It works. I hope that this commnet is useful. Thanks.
@kelvin3d Nope still doesn't work. I can see that the Nav$$anonymous$$esh misses out large areas of the floor. And does not include the spawn points!!!
Any other suggestions?
I had a similar problem. But with $$anonymous$$e the Zombunny and Hellephant were moving in a straight line and would not move towards the centre. I played around with Voxel Size in Navmesh bake settings --> Advanced. After increasing the voxel size (for me it seemed to work around 0.08) the Navmesh covered enough of the floor for the enemies to navigate properly.
Note: I have Unity 2017.3 Installed. I'm not sure where Voxel Size would be located in older versions.
Your answer
Follow this Question
Related Questions
How do I get NavMeshAgents not to walk through objects? 3 Answers
"SetDestination" can only be called on an active agent that has been placed on a NavMesh. 0 Answers
Nav Agents bumping when on different heights 0 Answers
Navmesh problem with characters rotation in the terrain 1 Answer
All my NavMeshAgents are tilted 1 Answer