linkSpawn Object Attached (AN_TFA_SpawnObjectAttached)

Spawns an object and attaches it to a socket.

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

AN_TFA_SpawnObjectAttached is the notify to use when you want a temporary prop to appear and stay attached to the character mesh. It is especially handy for reload props, handheld devices, and other animation-driven cosmetic items that should remain socketed until another gameplay event removes or throws them.


Quick Navigation



Purpose


Common uses include:

  • Temporary props during an animation, such as a magazine in the hand

  • Cosmetic handheld or body-mounted attachments, such as tools or devices


Owner Requirement


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


Quick Setup


1

Add the Notify to the Animation

Add AN_TFA_SpawnObjectAttached to the montage or sequence at the frame where you want the prop to appear. If you want the item to pop directly into the hand, place it exactly on the contact frame.

2

Pick What to Spawn

Set ObjectToSpawn to the actor class you want to attach. If ObjectToSpawn is None, nothing will spawn.

3

Choose the Socket and Align It

Set SpawnSocketName to the target socket or bone, then tune LocationOffset and RotationOffset until the prop lines up correctly.

4

Plan the Cleanup

This notify only spawns and attaches the prop, so you still need a cleanup plan. You can destroy the prop manually, transition into Throw Physics Object (AN_TFA_ThrowPhysicsObject), or rely on perspective-switch cleanup because the prop gets tagged as DisposableItem.


Notify Blueprint Flow


This notify is implemented in Received_Notify. It gets MeshComp.GetOwner(), casts the owner to BP_TFA_BaseCharacter, and then calls Character.SpawnObjectAttached(...). If the cast fails, nothing happens.

circle-info

The notify itself does not contain the spawn and attach logic. It delegates that work to BP_TFA_BaseCharacter::SpawnObjectAttached.

Readable Blueprint Flow


What the Character Function Does


The notify forwards into BP_TFA_BaseCharacter.SpawnObjectAttached(...). The main implementation lives inside the composite graph CGraph_SpawnObjectAttached.

Parameter Mapping

  • ObjectToSpawnClassToSpawn

  • AnimationAnimationToPlay

  • SpawnSocketNameSpawnSocketName

  • LocationOffsetLocationOffset

  • RotationOffsetRotationOffset

  • VisibilityDelayDelayBeforeVisible

High-Level Behavior

When called, the character function:

  1. Builds a spawn transform from the socket transform plus offsets

  2. Spawns the actor with AlwaysSpawn

  3. Adds the DisposableItem tag to the actor

  4. Attaches the actor to Mesh at SpawnSocketName

  5. If the actor has a SkeletalMeshComponent, hides it, optionally plays AnimationToPlay, waits for DelayBeforeVisible, and then shows it again if the actor still exists

Readable Character-Side Flow

circle-exclamation
circle-info

The function always adds the DisposableItem tag. That is what makes later cleanup on the character side possible.


Parameters


ObjectToSpawn

This is the actor class that gets spawned and attached to the socket. Typical examples are reload magazines, tools, or small handheld props.

Practical tips:

  • Keep the prop pivot at the point that should sit on the socket

  • You do not need to manually add the DisposableItem tag, because the character function already does that

Animation

This optional animation sequence is forwarded as AnimationToPlay. It is most useful for skeletal props with moving parts. Leave it as None for static mesh props.

SpawnSocketName

This is the socket or bone on the character mesh that receives the prop. The default is ik_hand_l.

Useful patterns:

  • ik_hand_l or ik_hand_r for in-hand props

  • Spine, chest, or head sockets for devices or body-mounted items

circle-exclamation

LocationOffset

This is a local translation offset applied on top of the socket transform. Unreal units are centimeters, and the axes follow the socket’s local space.

Best practice:

  1. Fix the prop pivot first

  2. Use small offsets for final alignment

circle-exclamation

RotationOffset

This is a local rotation offset applied on top of the socket rotation. It is useful when the prop needs to face a slightly different direction without changing the socket itself.

circle-exclamation

VisibilityDelay

This value is forwarded as DelayBeforeVisible. It is useful for syncing the prop’s visible appearance with the exact hand contact or reveal timing in the animation.

Default Values

  • ObjectToSpawn = None

  • Animation = None

  • SpawnSocketName = ik_hand_l

  • LocationOffset = (0, 0, 0)

  • RotationOffset = (0, 0, 0)

  • VisibilityDelay = 0.0


Placement Tips


  • Place the notify on the frame where the prop should appear

  • When swapping magazines, pair it with a weapon-side magazine hide state or a later throw or destroy notify

  • Keep socket naming consistent across your first-person and third-person character meshes


Example Setups


Magazine in the Left Hand During a Reload

  • ObjectToSpawn: your magazine prop actor

  • SpawnSocketName: ik_hand_l

  • LocationOffset: start near (0, 0, 0)

  • RotationOffset: start near (0, 0, 0), then tune yaw and pitch

  • VisibilityDelay: 0.0 for instant appearance, or about 0.05 to 0.15 to better match contact timing

Cleanup options:

Device Appears in Hand Without Obvious Pop-In

  • Place the notify slightly early

  • Use VisibilityDelay so the prop becomes visible exactly when the hand closes or the device clears the body


Troubleshooting


  • Nothing happens

    • The animation is playing on a mesh not owned by BP_TFA_BaseCharacter

    • ObjectToSpawn is None

  • The object spawns, but not where you expect

    • Check SpawnSocketName

    • Tune LocationOffset and RotationOffset

  • It spawns correctly once, then duplicates

    • The notify is firing multiple times because of loops, section jumps, or replays

    • Add explicit cleanup or rely on a consistent DisposableItem cleanup rule

  • It looks aligned in first person but off in third person

    • The socket exists on both meshes, but the transforms differ

    • Copy socket transforms between skeletons if you want identical placement


Notes and Gotchas


  • This notify only forwards parameters. The real spawn and attach rules live in BP_TFA_BaseCharacter::SpawnObjectAttached.

  • Received_Notify returns false here, even though the side effects can still happen.

  • If your tools depend on the return value, consider changing that behavior in your local version.

  • If you use disposable animation props, keep your cleanup rules consistent, because the pack commonly relies on the DisposableItem tag.



Last updated

Was this helpful?