- Home /
 
Weapon reload animation problem in UFPS
Hi,
I'm using Ultimate FPS to create a custom player for my game. I have three gun models with reload animations(a handgun, a rifle, & a Sniper).
I assigned my animation clip on the vp_FPWeaponReloader script, and this script is attached to my weapon prefab.
now my problem is whenever i try to switch to the next weapon while the current weapon's reload animation is playing and again switch back to the previous weapon, i find my previous weapon's position changed upon the previous animation paused state....and now i couldn't play the animation for the previous weapon upon 'R' key press.
Can anyone help solve this issue...is there any way i could solve this issue by making any changes over "vp_FPWeaponReloader" script....
Answer by PICHU · Dec 22, 2013 at 06:46 AM
Added some code in Onstop_Reload() function on vp_FPWeaponReloader script....
 if(AnimationReload != null) 
         {
             m_Weapon.WeaponModel.animation[AnimationReload.name].time = 0.0f;
             m_Weapon.WeaponModel.animation.Sample();
             m_Weapon.WeaponModel.animation.Stop(AnimationReload.name);
         }
 
              Answer by gringan · Dec 05, 2016 at 07:33 AM
I have same problem as you.
I use 1.7
I tryed your code and i had to change it like this but that dont work , i have same problems.
 protected override void OnStop_Reload()
     {
         base.OnStop_Reload();
 
         if (AnimationReload != null)
         {
             m_WeaponAnimation[AnimationReload.name].time = 0.0f;
             m_WeaponAnimation.Sample();
             m_WeaponAnimation.Stop(AnimationReload.name);
         }
     }
 
               Anyone can help please ?
My problem is the same as in this video :
Your answer