bulletEject Casing (AN_TFA_EjectCasing)

Emits a casing at the ejection frame.

Asset path: /Game/InfimaGames/TacticalFPSAnimations/Common/Core/Animation/AN_TFA_EjectCasing

AN_TFA_EjectCasing is the notify used when a casing should eject during firing, inspection, or weapon-clearing animations. Like AN_TFA_DropMagazine, this is a weapon-owned notify, so it only works when the active animation is playing on a mesh owned by BP_TFA_BaseWeapon.


Quick Navigation



Purpose


Use this notify when you want a casing to eject at a specific animation frame.


Owner Requirement


This notify only works when the active animation is playing on a mesh owned by BP_TFA_BaseWeapon.


Notify Blueprint Flow


This notify is implemented in Received_Notify. It gets the owner from MeshComp, casts that owner to BP_TFA_BaseWeapon, builds a randomized RotationOffset from the configured min and max rotators, and then calls Weapon.EjectCasing(RotationOffset, MinEjectForce, MaxEjectForce, RotationSpeed). If the cast fails, nothing happens.

circle-info

This notify does not spawn the casing directly. It delegates the actual work to BP_TFA_BaseWeapon::EjectCasing.

Readable Blueprint Flow


Parameters


Force Tuning

  • MinEjectForce

  • MaxEjectForce

These define the random ejection-force range used by the weapon.

Rotation Tuning

  • RotationSpeed

This value is passed into EjectCasing as the spin amount.

Rotation Offset Randomization

  • MinEjectRotationOffset

  • MaxEjectRotationOffset

On notify fire, the Blueprint breaks both rotators into roll, pitch, and yaw, randomizes each axis with RandomFloatInRange, then rebuilds the final RotationOffset with MakeRotator.

circle-exclamation
circle-info

This per-notify randomization is great for adding subtle variation so every casing does not eject on the exact same path.

Default Values

  • MinEjectForce = 50.0

  • MaxEjectForce = 65.0

  • RotationSpeed = 0.0

  • MinEjectRotationOffset = (Pitch=0, Yaw=0, Roll=0)

  • MaxEjectRotationOffset = (Pitch=0, Yaw=0, Roll=0)

With the default setup, the casing uses a random ejection force between 50 and 65, and it gets no extra rotation offset until you change the min and max rotators.


What EjectCasing Does


BP_TFA_BaseWeapon::EjectCasing handles the actual spawn and physics work.

Implementation summary:

  • Spawns BP_TFA_PhysicsCasing at CurrentConfig.SocketCasingEject on SK_Receiver

  • Assigns ImpactSound = CurrentConfig.SoundCue_WEP_CasingEject when supported

  • Sets the mesh to CurrentConfig.MeshBulletCasing

  • Applies impulse using the forward vector of CombineRotators(SocketRotation, RotationOffset)

  • Chooses force from the range [MinEjectForce, MaxEjectForce]

  • Applies linear impulse with bVelChange = false

  • Applies angular impulse with a random axis scaled by RotationSpeed and bVelChange = true

See Base Weapon (BP_TFA_BaseWeapon) for the fuller weapon-side breakdown.


Placement Tips


  • Place the notify on the frame where the bolt or eject motion looks correct

  • Put it on the montage that plays on the weapon mesh

  • Keep the rotation offsets relatively small, because large offsets usually make the casing look like it teleported sideways


Troubleshooting


  • Nothing happens

    • The animation is playing on a mesh that is not owned by BP_TFA_BaseWeapon

    • BP_TFA_BaseWeapon::EjectCasing exits early for your setup



Last updated

Was this helpful?