Melee Weapons Enable Zoom State

wwg Posts: 4Member
Hi,
On the VP_FPWeapon.cs script, when the Animation Type variable is set to Melee, the Zoom keys are disabled. How can I get Zoom to work with Melee weapons?

Thanks!

Best Answer

  • dmitch12sdmitch12s Posts: 83
    Answer ✓
    In vp_Weapon take out this function on line 508 (im still using an old version could be different line)

    protected virtual bool CanStart_Zoom()
    {

    if (Player.CurrentWeaponType.Get() == (int)vp_Weapon.Type.Melee)
    return false;

    return true;

    }

Answers

  • TryThisTryThis Posts: 887Member
    Do the zoom keys work okay in Demo Scene 3?
  • wwg Posts: 4Member
    edited November 19
    Thanks for the quick response! I should have provided more information about my scenario.

    The zoom works perfectly in all my scenes, but only on weapons where the weapon Type variable is set to something other than Melee (on the VP_FPWeapon.cs script under Animation foldout).

    When the weapon Type is set to Melee, the Zoom state still works if I enable it manually via the inspector, but not via key press. It appears that somewhere the UFPS code is checking for the weapon type and preventing/blocking the zoom input. I briefly looked through a vp_FPWeapon.cs and vp_FPInput.cs, but didn't find a way to override this functionality.

    Thanks for any suggestions!
  • wwg Posts: 4Member
    Does anyone know how I can do this?
  • wwg Posts: 4Member
    edited November 29
    Thanks @dmitch12s! I'm not sure why I didn't see that function.
Sign In or Register to comment.