Legacy:How UT Weapons Work/Switching To Another Weapon
From Unreal Wiki, The Unreal Engine Documentation Site
Switching weapons consists of two parts
- putting down the old weapon
- bringing up the new weapon
Putting Down The Old Weapon
Weapon changes can origin from different functions, like PlayerPawn.SwitchWeapon, .GetWeapon, .Prev/.NextWeapon or Pawn (UT).SwitchToBestWeapon. All these functions have a common structure:
- The pawn's PendingWeapon property is set to the new weapon.
- If the pawn's Weapon and PendingWeapon are already the same switching is aborted and nothing happens.
- If the pawn doesn't currently have a selected Weapon, PendingWeapon is brought up. Otherwise the current weapon's PutDown function is called. This function can in some cases abort the weapon change by returning False. (e.g. SwitchWeapon function)
Bringing Up The New Weapon
This part of the weapon change starts with the Pawn (UT).WeaponChanged function.
(...)