Quick-Start Guide

Learn how to quickly set up the firearms for the player character.

Prefer video tutorials? You can also watch the tutorial video I created for this pack here!

Using the provided player character

The pack includes blueprints for a player character, controller, and game mode. This player character comes with basic movement logic already set up (incl. sprinting and crouching).

If you decide to use these, getting started is as quick as dragging any firearm into your scene and pressing play (make sure you're using the GM_FPS_Default game mode). Weapons can be picked up using the E key.

Alternatively, you can equip the player with a weapon on spawn. Logic for this is already in the Begin Play event on the BP_FPS_Player blueprint - however, it's not connected by default.

Using a custom player character

There are two important steps you need to follow if you want to use the provided firearms with your custom player character.

Step One: Initialize Variables

In the BP_FPS_Firearm blueprint, open up the Initialize Variables function (called on Begin Play). Here, the firearm tries to get references to all essential components:

  1. Bullet Player Origin: An arrow component (needs to have the BulletOrigin tag) that defines where all bullets will spawn from. It is recommended that this arrow is parented to the player camera. The firearm must have this reference set, otherwise it won't know where the bullets should spawn from.

  2. Reserves Component: When reloading, the weapons try to access the ammunition reserves that are stored on the reserves component. Therefore, make sure you have the AC_FPS_Reserves component attached to your player character.

  3. Player HUD: The firearm will automatically try to update the player HUD widget whenever their magazine / chamber status is updated. To do this, it needs a reference to the a widget of the class WB_FPS_PlayerHUD.

    Feel free to use your own widget class. In this case, you can replace all functions called on the widget with your own logic. I recommend right-clicking the PlayerHUD variable in the BP_FPS_Firearm blueprint, then select Find References. This allows you to quickly find all locations where you need to swap out the hud function calls with your own logic.

Step 2: Pass on mouse input

In order for the procedural system to work, you must pass on all mouse input to the firearm that is held by the player character.

This is because the firearm will try to automatically try to return to the previous position after recoil is applied. However, when the player moves their mouse down to balance out the recoil, or if the player rapidly moves their mouse (they want to aim somewhere else), the aim return logic will be adjusted / stopped.

To do this, navigate to the player mouse input action. Presumably, you are already using this node to update the yaw and pitch of the player camera. Get a reference to the active firearm, call the Player Camera Input function, and pass on the action values for X and Y.

For the provided BP_FPS_Player, this logic is handled on the attached AC_FPS_PlayerMovement component.

To ensure that this system is set up correctly, try pulling the mouse down while firing a firearm. The automatic aim return should never go past the original point. If you rapidly move your mouse, the aim return logic should stop completely.

Last updated