vrfpskit-docs
  • User Manual
    • Getting Started
    • Setup Troubleshooting
    • Damageable Component
    • XRHeldInputAction
  • Weapons
    • Included Weapons
      • Glock 17
      • HK-416 (AR-15)
      • AKS-74U
      • Winchester Model 1897
      • Mosin Nagant
      • HK Mp5
      • M67 Grenade
    • Firearm Components
      • Firearm
      • MagazineInteractor
      • CyclingFirearmAction
      • Input Components
        • FirearmTrigger
      • Physical Input Components
        • PhysicalUnlockActionTrigger
        • PhysicalFireSelectInteractor
        • MagazineCollisionDetacher
    • Creating Firearms
      • Animating the Firearm
  • Multiplayer
    • Authority Handling
    • Multiplayer Troubleshooting
    • Mirror Networking Docs
  • XR Interaction Toolkit Docs
  • Support Discord
Powered by GitBook
On this page
  1. Weapons
  2. Firearm Components

MagazineInteractor

Last updated 1 year ago

MagazineInteractor extends XRInteractionToolkit's XRSocketInteractor and as such mostly behaves as one. It checks magazine combability, cooldowns, updates Firearm.magazine when a magazine is attached, and limits player detaching. The MagazineInteractor also has a custom attachment point for the magazines, the "Weapon/model/magazineRenderPoint" object, which is manipulated by the Firearm's animations.

In multiplayer, it is recommended to have a little larger hitbox to help with position inaccuracies.

The allowGrabMagazine variable determines whether the player can simply grab the attached Magazine in order to detach it. This is done to reflect the real life Firearm's Magazine detach process, which often can require further input. Most AK's simply allows you to grab the magazine, while the AR-15 platform requires you to engage the magazine release button.

You can extend detaching behaviour with the MagazineEjectorInput Component, which detaches magazine upon controller input. The AK platform also features the unique component, which detaches the current magazine upon collision, making it possible to perform the famous "Emergency AK Reload"

MagazineCollisionDetacher
MagazineInteractor hitbox on the
AK Emergency Reload [@AleksWorkshop]