dav
Full vMember
Posts: 56
|
Post by dav on Sept 26, 2018 16:07:42 GMT
I usually get this error once the IA is moving:
navmeshagent.velocity assign attempt for 'IA _Character_Goblin_Pistol (5)' is not valid. Input velocity is { NaN, NaN, NaN }. UnityEngine.AI.NavMeshAgent:set_velocity(Vector3) Invector.vCharacterController.AI.vControlAI:OnAnimatorMove() (at Assets/Invector-AIController (Beta)/Scripts/AI/AI Controllers/vControlAI.cs:213)
I don't post the code because Invector's privacy terms, but is in vcontrolAI.cs:
protected override void OnAnimatorMove()
line:
navMeshAgent.velocity = ((animator.deltaPosition) / Time.deltaTime) * Mathf.Clamp(remainingDistanceWithoutAgent - stopingDistance, 0, 1f);
Any idea? Thanks
|
|
|
Post by Invector on Sept 26, 2018 16:47:34 GMT
Hmm strange, does this happens as soon as you hit play or sometimes? Did you bake the navmesh?
|
|
|
Post by sectuz on Sept 26, 2018 17:13:03 GMT
This was happening to me, when i pause the game (delta time is 0) to show pause menu. During that time, until delta time is not 0 this error is spamming my console.
|
|
|
Post by sectuz on Sept 26, 2018 17:13:50 GMT
I think i disabled AI during pause menu to fix this.
|
|
|
Post by tharindu on Sept 26, 2018 18:55:16 GMT
Pretty sure it's a division by zero error if NaN is around
|
|
|
Post by uberwiggett on Sept 27, 2018 10:03:46 GMT
yes this pops up on start for me too, it's a calculation error like tharindu said, it occurs when the character isn't able to move (ie when the startup occurs or during a pause) and tries to do a calculation, it does not break anything though.
|
|
|
Post by spf on Sept 27, 2018 22:11:42 GMT
I have the same problem :(
|
|
|
Post by Invector on Sept 28, 2018 2:25:46 GMT
Oh we used to have this issue with the old AI as well, it's pretty simplae actually... Just add a if(Time.time <= 0) return; or something like that in the AnimatorMove method.
I will take a look better tomorrow and post a quickfix here ;) Now it's time to zzzZZZzZzZzzZzZ
|
|
|
Post by theone on Nov 18, 2018 9:01:08 GMT
Oh we used to have this issue with the old AI as well, it's pretty simplae actually... Just add a if(Time.time <= 0) return; or something like that in the AnimatorMove method. I will take a look better tomorrow and post a quickfix here ;) Now it's time to zzzZZZzZzZzzZzZ Hi Invector, I am receiving the same error when pausing my game. I am using the The Shooter Template + FSM AI Template + Adventure Creator Integration. In the Adventure Creator Integration part of the forums, in August 2017, you have advised with: Open the v_AIAnimator script and replace line 61 to if (Time.timeScale <= 0.1f) return Then advised with: I remember that someone already ask about this before, did a about navmeshagent.velocity and find the anwser here in the forum, just replace line 62 to this: if (agent.enabled && !agent.isOnOffMeshLink && agent.updatePosition && Time.deltaTime != 0) I have tried the three suggestions and experimented a bit more but it does not seem to be working. Any advice please? My error is: navmeshagent.velocity assign attempt for 'AI - Arena_Red_Shooter (1)' is not valid. Input velocity is { NaN, NaN, NaN }. UnityEngine.AI.NavMeshAgent:set_velocity(Vector3) Thank you very much.
|
|
|
Post by Invector on Nov 20, 2018 15:00:21 GMT
I did the fix yesterday, it's pretty simple... just add the verification inside the method OnAnimatorMove of the vControlAI
if(Time.deltaTime == 0) return;
|
|