Forum rules - please read before posting.

Walk/Input delay after dialogue/conversation

Hey all - 

Running into something that I'm not quite sure how to track down.  My player is experiencing a delay in movement after a largish dialogue/conversation sequence occurs.  The dialogue/conversation will end, I'll press "forward" to get him to start walking and he'll turn in that direction and stay still for a few seconds (sometimes upwards of 5 seconds) and then start walking...all while I have the "forward" button held down.

Anyone else experiencing this?  I'm wondering if I have something screwed up in my animation controller...like something is getting interrupted when I go into a dialogue/conversation and then it gets caught in that state until it resets or something.  Not sure.  Maybe input is getting trumped when I'm in a dialogue state?

Any ideas?

Comments

  • Oh yeah - an additional note, I can turn with no problems while this delay in input is happening.  I can spin in a circle but just can't move forward...
  • Strange.  Have you tried checking "Show Active ActionLists in Game window?" (at the bottom of the Settings Manager) to see if perhaps any Actionlists are blocking gameplay?

    If that goes nowhere, try ending your large sequence prematurely at different points to see if there's a point at which this problem no longer occurs - we'll then be able to narrow down the cause.
  • edited January 2016
    I'm not seeing anything out of the ordinary in the Active ActionLists...however, I did notice that this seems to happen if the player actually talks.  I just tested a sequence where the player reads a large passage from a book that the narrator reads and the player responds at the end.  When I removed the player response at the end of the sequence, she walked around just fine without a delay.  Hmmm...I wonder if I have something setup strangely on her head or body layers when she goes into a talk animation...
  • Are you using Mecanim to animate the Player?  It might be worth keeping the Animator window open to spot anything out of the ordinary.
  • Hmmmm...I wonder if this is all tied to the Character Controller (I'm not using Rigidbody + Capsule Collider due to the amount of stairs that are in my game).  I am using Mecanim but I don't get any feedback in the Animator window when monitoring something that is using a Character Controller.

    Might be a Unity bug?
  • It's hard to say.  Try placing the Demo game's player prefab, Tin Pot, in the scene and re-running it.  He'll override your own prefab, and we can see if it's the player set-up that's the issue.
  • is this direct input?

    is there a sneaky collision collider stopping you ? or maybe is coming into contact with the npc colider?
  • @ChrisIceBox - Just replaced my player with Tin Pot and there was *no* delay after he spoke like I'm experiencing with my player...I also tried replacing Tin Pot's capsule collider and rigidbody with the character controller to see if I could replicate, but no luck.  He's still behaving as he should.

    Hmmm....

  • There'll have to be some key difference with your own prefab then.  Try changing Tin Pot's set up bit-by-bit to replicate your own - presumably it'll stop working eventually and we'll then know the cause.
  • Okay - I'll give it a shot, thanks.  I'm a bit suspicious of Final IK as well, so I'll try ripping that stuff off.
  • Finally got a chance to work on my project again after a couple of months of crunch and seemed to find the root cause of this.  I narrowed it down to my transition from walk to idle.  If I have "Fixed Duration" checked, then I will get a delay on input if the player speaks.  If I don't have that checked, he/she walks away without any delay after he/she says something.  Unfortunately, if I don't have it checked, and I stop walking in the world while I'm exploring around, then my player will stay frozen in the frame of animation that I stopped in and not return to the idle animation.  This doesn't seem to be an issue if I don't have the "Speed" parameter checked, either.  

    Wacky.
  • I can't tell if that's a problem with AC or Unity.  Screenshots to help explain?  I wouldn't have thought non-fixed duration would stop the transition from occuring.
  • edited February 2016
    Sure...here's a high level breakdown of my settings:

    Animation Controller that's being used - https://www.dropbox.com/s/msf2vh251juqluk/Screen_Controller.png?dl=0 

    Walk -> Idle Transition that has a fixed duration - it doesn't matter how fast/slow I make the duration, it will always cause an input delay after the character speaks) - https://www.dropbox.com/s/7a11vnfjnke6m7m/Screen_Lag.png?dl=0

    Walk -> Idle Transition that does not have a fixed duration - this fixes the input delay after the player speaks, but it causes the animation to freeze on the last frame that was used if you stop moving.  ie: it never goes back to full idle - https://www.dropbox.com/s/5rl7uxcrmz20vgx/Screen_NoLag.png?dl=0

    Speed Parameter - Pretty straightforward.  I'm using the Speed parameter.  The interesting thing here is if I do NOT use the Speed parameter and I do NOT have a fixed duration on my Walk -> Idle transition, I will STILL get an input delay after the player speaks - https://www.dropbox.com/s/zxr5mi1ssnmblc8/Screen_SpeedParameter.png?dl=0

    Player Settings - Here is how I have my player set-up.  Remember, I'm not using Capsule Collider/Rigidbody due to the amount of stairs that are in my game.  Not sure if that's a culprit here, but worth noting.  I have to use stairs in my game. https://www.dropbox.com/s/4qc4h1o9q2skl51/Screen_Player.png?dl=0

    Hopefully, some of this is helpful!  Let me know if you need more detailed shots in specific areas.  Thanks for looking at it, Chris!!

  • That it freezes if you remove the fixed duration sounds like a Unity bug so far as I can tell.  If the conditions are being met but it doesn't behave as it should, that's all I can deduce.  AC won't do anything beyond manipulating your parameters unless you explicitly call an animation clip using Character: Animate.

    Are you using the experimental super-accurate setting?  I recently fixed some bugs involved with that when combined with Direct movement.

    If you want to control the speed of the walk animation with movement speed, try using a Blend tree instead of factoring the Speed parameter directly into the clip.  You should be able to combine the idle, walk and turn animations into a single sub-state, which has worked well for my own tests.
  • Chris, would you mind posting a screen shot of your controller-graph/blend-tree?  I have a basic one setup and it is working better, but I'd like to massage some of the data (like blending from walk to idle a bit more smoothly and implementing turns) and not quite sure of my settings.  I'm going through the unity tutorials and stuff, but having a reference of how it works in AC directly with your recommend settings would be great.

    Thank you!  Looks like the blend-tree option will be a better way to go!
  • This is with a 2D blend-tree, which is a bit more complicated because it also takes a Turn parameter to get nice turning animations.  These are all just the ones that come with Unity's Standard Assets though:

    image

    image
  • This looks like it's working great!  Thanks, so much, Chris!  I'll start doing this for the rest of my characters.
  • Quick follow-up.  This seems to be working for the most part, however, if I try to use Character: Animate and try playing a custom animation, I have to have a transition time of 0 (snap to the animation), I can't get the animation to play reliably if I have a transition time to blend from one to the other.  Do I have to have the blend state setup differently in order to use Character: Animate?
  • I don't believe so.  Not reliable in what way?  Does it only play half the time, or is it getting delayed?  Be sure to uncheck "Has exit time" for the transition.
  • I decided to approach this a bit differently.  Instead of using Play Custom, I created a new Bool and am transitioning from that.  That seems to be a bit more reliable.

    Basically, what it would do is it would act like the animation wasn't being triggered.  It would sit there and then if I pressed an arrow button to have the player walk around, it would snap to the animation and then move around the world in that animation.  Either that or it would transition incredibly slowly to the target animation.  I would have the transition time set to something like .05 and it would take about 10 seconds to actually transition.  I'm wondering if it it's because the blend tree is at a specific "speed" so the animation graph was transitioning at that speed multiplier (from idle it would have been 0).
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.