Tasharen Entertainment Forum

Support => TNet 3 Support => Topic started by: Willie Prinsloo on May 01, 2013, 01:21:11 PM

Title: NavMeshAgent stop working if an prefab is created with TNManager.Create
Post 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.




Title: Re: NavMeshAgent stop working if an prefab is created with TNManager.Create
Post by: ArenMook on May 02, 2013, 03:38:27 AM
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.
Title: Re: NavMeshAgent stop working if an prefab is created with TNManager.Create
Post by: Willie Prinsloo on May 02, 2013, 12:31:59 PM
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.

Title: Re: NavMeshAgent stop working if an prefab is created with TNManager.Create
Post by: ArenMook on May 03, 2013, 08:52:47 AM
Your error happens in Update. Verify that it happens after your Start(). Unity's networking is different.
Title: Re: NavMeshAgent stop working if an prefab is created with TNManager.Create
Post by: Willie Prinsloo on May 03, 2013, 03:26:53 PM
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.
Title: Re: NavMeshAgent stop working if an prefab is created with TNManager.Create
Post by: Willie Prinsloo on May 06, 2013, 03:35:54 PM
Did anybody test this on TNet?

It's an important unity Framework....
Title: Re: NavMeshAgent stop working if an prefab is created with TNManager.Create
Post by: ArenMook on May 06, 2013, 03:58:34 PM
If you send me a repro case, I'll have a look at it: support at tasharen.com