Tasharen Entertainment Forum
Support => TNet 3 Support => Topic started by: Willie Prinsloo on May 01, 2013, 01:21:11 PM
-
Hi All
For some reason NavMesgAgent fails with following message if I initiate my prefab with TNManager.Create:
"SetDestination" can only be called on an active agent that has been placed on a NavMesh.
UnityEngine.NavMeshAgent:set_destination(Vector3)
AITankController:goToDest() (at Assets/Scripts/AI/AITankController.cs:82)
AITankController:Update() (at Assets/Scripts/AI/AITankController.cs:56)
NavMesgAgent works fine with unity networking or without networking.
-
Has it been placed on a nav mesh by the time you get the Update? Chances are you're missing some RFC call at that point. Just debug your order of function calls.
-
I'm using a Nav Mesh Agent component that's attached.
At the Start() method I get a reference to the attached Nav Mesh Agent component:
agent = GetComponent<NavMeshAgent>();
I also tried to get the reference at the Update method.
AS per my pervious post this is working 100% on unity networking.
-
Your error happens in Update. Verify that it happens after your Start(). Unity's networking is different.
-
I did try to use "agent = GetComponent<NavMeshAgent>();" in the update() method.
It's still failing. It might be a good idea for Tasharen to test this with their framework.
-
Did anybody test this on TNet?
It's an important unity Framework....
-
If you send me a repro case, I'll have a look at it: support at tasharen.com