Announcement

Collapse
No announcement yet.

Weapon Swinging problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Weapon Swinging problem

    Ok Im probably an idiot but.

    I have a weapon, and the alt-fire is defined to swing the weapon instead of fire it.

    This works great if I click the button once and let it play out.

    If I hold the button down, though, the animation won't play over and over again. In fact, the animation won't play at all.

    The only difference between the swinging of the weapon and the firing of the weapon, is right here:

    Code:
    function PlayFiring()
    {
      if ( Weapon.Mesh != None )
      {
       	Weapon.PlayAnim('Swing', FireAnimRate, TweenTime);
      }
      Weapon.PlayOwnedSound(FireSound,SLOT_Interact,TransientSoundVolume,,TransientSoundRadius,Default.FireAnimRate/FireAnimRate,false);
      ClientPlayForceFeedback(FireForce);  // jdf
    
      FireCount++;
    }
    And in defaults:
    Code:
      FireRate=2.000000
      TweenTime=0.0500
      FireAnimRate=1.0000
    Anyone got any ideas? The actual "firing" gets done because the bots are taking damage (when I hold it down that is). It's just the silly animation.

    #2
    And I tried with Firerate=1.000

    Comment


      #3
      I remember reading something about this.
      Look up FinishAnim(); in the following doc:
      http://www.leveldesigner.com/index.p...n=doc&ID=71#21

      I think that since you are holding down your mouse button the Event keeps getting triggered REALLY fast thus keeps starting the animation and looks like its not animating.

      Hope it helps

      Qjahe

      Comment


        #4
        Ok I fixed it.

        The problem was that I was overriding the ModeDoFire event, but never calling the super.ModeDoFire().

        Also, I deleted my override of the PlayFiring function, and just set the FireAnim= to my swing animation.

        Thanks all.

        Comment

        Working...
        X