πŸ”«Adding a Weapon

This page explains how to add a weapon with the FPS Addon.

Gun Prefab

Let's add an SMG to our character. We will use the demo A_W_SMG prefab and drag and drop it under the character's IK weapon_bone GameObject.

Locate this prefab.
Attach it to the gun bone.

Click on this prefab and find the Weapon component. Assign previously created CAS asset here:

Assign the settings.

This links the overlay and procedural settings to this weapon, so when it’s equipped, CAS will use the correct animation data.

Now, let’s press Play and see how it looks in-game.

Overlay Animator Controller

If you use a Humanoid or a different Generic character, it won't look great out of the box:

To fix this issue, go to Create/Animation/Animation Override Controller:

Use AC_CAS_FPS_Character as Controller.

Here we need to assign:

  • Idle_Aim: This is your weapon idle pose.

  • Idle_Rest: This is a weapon pose when not aiming in third-person.

  • Idle_Rest_Crouch: Same as Idle_Rest, but used only when crouching.

circle-check

Assign this controller in CAS settings as Overlay Animator:

Weapon Pose

If your animations do not use a weapon bone, or your model is Humanoid β€” the weapon will follow the right hand by default:

Weapon pose in first-person view.

Click the axis button in the Procedural Animation asset:

Toggle this icon.

This will enable control Gizmos, which you can use to position the weapon in the editor:

Use translation and rotation controls.

Fixing Left Hand

Select the SMG prefab, and locate attachment game objects:

Select grip attachmnets one by one.

Assign the animations compatible with your character in the Grip Attachment inspector:

Assign the right clip here.

Once the correct clips have been assigned, the character left hand pose will look normal:

Correct left hand position.

Last updated