|
Post by warpzone on Mar 30, 2017 5:47:41 GMT
Hey. I'm using Melee Combat and ThirdpersonController. I tried pausing the game with Time.timeScale = 0; That gives me this:
navmeshagent.velocity assign attempt for 'CopperEnemy' is not valid. Input velocity is { NaN, NaN, NaN }. UnityEngine.AI.NavMeshAgent:set_velocity(Vector3) Invector.v_AIAnimator:OnAnimatorMove() (at Assets/Invector-3rdPersonController/Melee Combat/Scripts/CharacterAI/v_AIAnimator.cs:63)
It happens once for each enemy every time I unpause the game. How do I fix this?
EDIT: What's really weird is, just before the offending line 63, line 61 says if (Time.timeScale == 0) return;
Apparently that's not doing its job?
Am I seriously the first person to try and pause the game? O.o
|
|
|
Post by warpzone on Mar 30, 2017 7:12:16 GMT
Search led me to this thread: invector.proboards.com/post/4128/thread Somehow, I don't think I understood the advice given in that thread. When I moved the code to vGameManager, it still didn't work.
|
|
|
Post by Invector on Mar 30, 2017 18:53:56 GMT
if (Time.timeScale == 0) return; was supposed to work... try != 0 and add the content inside instead of the return.
|
|
|
Post by warpzone on Mar 30, 2017 20:07:21 GMT
Yeah, I ended up doing something like that. From the other thread:
Mar 30, 2017 12:11:29 GMT -5 warpzone said: Figured it out. (It's amazing what a good night's sleep will do.) The problem is vGameManager is BUGGED out-of-the-box. Specifically, line 63 will fail when Time.deltaTime is zero (such as during ANY pause that relies on TimeScale) because it tries to divide by zero, resulting in a NaN velocity. To fix, change line 62 to:
if (agent.enabled && !agent.isOnOffMeshLink && agent.updatePosition && Time.deltaTime != 0){
Basically, we only call this section when Time.deltaTime isn't zero.
ALL the rest of the replies in (the other thread) are bumpkiss. I can only assume these other replies were good advice in a previous version of the product.
Seriously, though. ALL action games need to pause. How is it nobody else caught this?
|
|
|
Post by uberwiggett on Mar 31, 2017 7:10:18 GMT
Not sure what the problem was, game pauses whenever I open the equip menus.
|
|
|
Post by shadex on Apr 3, 2017 19:08:21 GMT
Not sure what the problem was, game pauses whenever I open the equip menus. Same, though i am debating on commenting it out. Wrestling with the idea of someone scrambling to switch weapon types in the middle of combat.
|
|
|
Post by tharindu on Apr 5, 2017 10:33:33 GMT
Something related to game time. I am observing some major stuttering when I move the mouse around after setting the game timescale so that the game isn't entirely paused to achieve a kind of slow motion effect for certain combos. Anyway I can correct that ?
|
|
|
Post by shadex on Apr 5, 2017 22:29:17 GMT
Something related to game time. I am observing some major stuttering when I move the mouse around after setting the game timescale so that the game isn't entirely paused to achieve a kind of slow motion effect for certain combos. Anyway I can correct that ? Ohh that is such a good idea rindu! I might mess around with that later on. The stuttering may be from the way the item menu is handled. Haven't looked indepth in the code, but it's most likely prioritizing the mouse over positioning over the keyboard. in the default scene if you move the mouse after you hit I, and use the directional arrows to select your weapons, it will bounce back to the item the mouse is over. Not sure if that helps, but it may be a good enough hint.
|
|
|
Post by tharindu on Apr 6, 2017 2:09:50 GMT
Something related to game time. I am observing some major stuttering when I move the mouse around after setting the game timescale so that the game isn't entirely paused to achieve a kind of slow motion effect for certain combos. Anyway I can correct that ? Ohh that is such a good idea rindu! I might mess around with that later on. The stuttering may be from the way the item menu is handled. Haven't looked indepth in the code, but it's most likely prioritizing the mouse over positioning over the keyboard. in the default scene if you move the mouse after you hit I, and use the directional arrows to select your weapons, it will bounce back to the item the mouse is over. Not sure if that helps, but it may be a good enough hint. Actually that makes sense and could possibly be it. I will look at the code today and see.
|
|