Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
1
Question by ltrout1999 · Jan 10, 2016 at 06:22 PM · errornavmesh

SetDestination can only be called on an active agent that is on a NavMesh.

So I've ran into a little problem with my tank game. The tanks both spawn perfectly for the first/starting round, but after the enemy kills the player or vice versa, the enemytank respawns where it should and just sits there and gives me this error

 "SetDestination" can only be called on an active agent that has been placed on a NavMesh.
 UnityEngine.NavMeshAgent:SetDestination(Vector3)
 EnemyInfo.EnemyMovement:Update() (at Assets/Scripts/EnemyTank/EnemyMovement.cs:45)
 

I'm not quite sure how to go about fixing this. The Tanks! Tutorial on Unity's website is what I based my game off of, but I created a little AI to make it a singleplayer game. Any help?

If you would like to see all of the classes, Here is the Github link.

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image ltrout1999 · Jan 11, 2016 at 05:13 AM 1
Share

I have fixed it.

3 Replies

· Add your reply
  • Sort: 
avatar image
3

Answer by sebastiao_lucio · Jan 18, 2017 at 01:58 PM

Hello @ltrout1999! I had the same problem in the game I'm building for the game that I will teach "lego crossy road" on my channel SLTutorias on youtubehttps://www.youtube.com/channel/UClRHrHeybIcPVo-t6Jq8cnQ. There are two possible problems:

1º)In your scene click on a mesh or train and then in Window tabs select navigation... Now u can see navigation layout beside the inspector... Just in bake tab of navigation click the bottom button that says Bake... And you're done

If you have already done this and the problem persists:

2) probably the point where your gameobject is being instantiated outside the reach area of ??the mesh (terrain or plane or quad). Change the position of the spaw point into the area of ??the mesh.experiment by putting this spaw point in the center of the terrain to see. I hope I have helped! Good luck! Sincerely, SLTutorias

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image plati005 · Nov 05, 2018 at 02:09 AM 0
Share

this is super useful! clicking bake worked for me, thank you!

avatar image
0

Answer by najemzoabie40 · Oct 23, 2019 at 08:54 AM

You can try to set the plane as static, check the box in the inspector.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Moutik · Jan 04, 2020 at 03:40 PM

"probably the point where your gameobject is being instantiated outside the reach area of the navmesh" => that did it for me, even though the gameobject was moved on a walkable area afterwards. It needs to be instantiated inside in the first place.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

46 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Unity Vuforia ARCamera affect the Navmeshagent of player?? 0 Answers

Enemyai.cs(31,19): error CS1061: Type `UnityEngine.NavMeshObstacle' does not contain a definition for `SetDestination' and no extension method `SetDestination' of type 1 Answer

Apple LLVM 9.0 Error, Unable to execute command: Killed:9 0 Answers

Setting button intractability causes an error 1 Answer

Unity broken, hangs at "Loading..." screen. Help! 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges