I am having a problem where my NavMesh Agent based Player walks further than he should when moving to markers, but only when instantiated. If he is present in-scene, then there is no problem.
There is also a worse problem: If the character is instantiated, then for some reason, actions for altering animator parameters won't work. But again, if the character is already in the scene, it works just fine.
Note that I chose to use the NavMesh agent because without it, the character has serious problems with pathfinding.
I also get this when the character is spawned:
Failed to create agent because it is not close enough to the NavMesh
UnityEngine.Object:Instantiate(Player, Vector3, Quaternion)
AC.KickStarter:ResetPlayer(Player, Int32, Boolean, Quaternion, Boolean, Boolean) (at Assets/AdventureCreator/Scripts/Game engine/KickStarter.cs:860)
AC.KickStarter:OnAwake() (at Assets/AdventureCreator/Scripts/Game engine/KickStarter.cs:989)
AC.MultiSceneChecker:Awake() (at Assets/AdventureCreator/Scripts/Game engine/MultiSceneChecker.cs:47)
This is in Unity 2017.1
Adventure Creator 1.62.2
This project uses Point & Click movement in a 3D environment.
Any help appreciated.
Comments
So, the NavMesh. When you say "in relation to the origin" do mean origin as in 0,0,0? If so, then it is quite a way off in every axis, though I wouldn't have though it would make a difference - I may be wrong of course.
The animation issue: For some reason, it will only set booleans to true for in-scene player characters. What's supposed to happen is, after an inventory combination, the player is switched to a different character (using the same animator), a boolean is set to true, which transitions from an idle state to a different idle state (holding a gun), which then is supposed to set another boolean to true which "aims" the gun when he walks to a marker. And it DOES, but only if the player is already in the scene...
Pathfinding without NavMesh Agent: I find this a lot less reliable than navmesh agent characters, to the point where the player character can barely even find his way around a corner without walking into it for five minutes. General movement is also affected, he struggles to climb the smallest of stairs for example. Locomotion animation generally looks better though - with navmesh agent integration it's a little bit "glidey" but at least it's less frustrating and more reliable this way. I've also been able to walk through walls using the default pathfinding method.
https://imgur.com/AFN7av7
An image of the animator
Let me know if there is something else I can tell you
Cheers
The animation states weren't changing because of the order I had the actions in the inventory item combination action list asset. Before, I had it setting a bool (animator parameter) then changing player character. When the player was switched, the new one didn't "remember" that the parameter had been changed, and so further animations would not play because they relied on that boolean being set in order to transition (that's also why he was walking too far - wrong walk animation being used). The solution was just to set it after switching player.
btw When I find time, I will look deeper into the "vanilla" pathfinding issues.
Cheers