Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
然而,当我去测试我的“僵尸”是否正确生成时,我正在关注 Unity 网站上的生存射击教程。它产生得很好,就像它应该的那样......直到我开始射击它们,当我杀死我的第一个敌人时,我得到了这个错误:
"SetDestination" can only be called on an active agent that has been placed on a NavMesh.
我已经尝试过重新烘焙我的环境,但这仍然不起作用。
似乎你的敌人,即使已经死了,也想接近你的玩家。
你确定你正在正确地摧毁敌人的游戏对象吗?此外,如果你正确地将敌人的生命值降至 0 或更低,它不应该在教程的上下文中发生,除非你忘记添加这个(在调用导航之前):
if(enemyHealth.currentHealth > 0 && playerHealth.currentHealth > 0)