Search Unity

ResetInputAxes and held-down inputs...

Discussion in 'Scripting' started by ChillWill, Aug 29, 2008.

  1. ChillWill

    ChillWill

    Joined:
    Aug 13, 2008
    Posts:
    13
    I have a quick question about the use of ResetInputAxes and holding down buttons. I have the following code to that checks a respawn before doing movement:
    Code (csharp):
    1.     void FixedUpdate()
    2.     {
    3.         if (respawn)
    4.         {
    5.             Input.ResetInputAxes();
    6.             Reanimate();
    7.             respawn = false;
    8.         }  
    9.         else           
    10.             MovePlayer();
    11.     }
    What I'm trying to do is to play the Reanimate function (which just plays a reanimate animation) to revive the player, while during the process ignoring input. During the animation, ResetInputAxes does the trick, but this doesn't account for controls that are held down before the animation plays out.

    Is there a way to ignore held-down buttons before my Reanimate animation plays? Basically, I want the animation to fully play out before the player has control over the character again.

    Thanks in advance for any help!
     
  2. ahmetDP_1

    ahmetDP_1

    Joined:
    Sep 23, 2010
    Posts:
    113
    any solution yet?