# Quick-Start Guide

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.

<figure><img src="/files/YvDl3jvG2Nc3exa985EK" alt=""><figcaption><p>Using the provided game mode makes the setup quick and easy.</p></figcaption></figure>

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.

<figure><img src="/files/n2toqWrJ1KHDvRljzifQ" alt=""><figcaption><p>Connect this section to the execution flow (BP_FPS_Player - Begin Play) to give the player character a weapon on spawn. </p></figcaption></figure>

## 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.<br>

   <figure><img src="/files/jbF5GsPk63FZGyATNHvU" alt=""><figcaption><p>Recommended Setup: The bullet player origin should be an arrow component that is attached to the player camera. Make sure a that the arrow has the tag <code>BulletOrigin</code>, otherwise the firearm won't be able to automatically get a reference to it.</p></figcaption></figure>

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.<br>

   <figure><img src="/files/dPtIjZyIDJKOgNvimkOX" alt=""><figcaption><p>This component should be attached to your player character.</p></figcaption></figure>

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`.<br>

   <figure><img src="/files/O5iAUjeesUMvf2ZyvZAG" alt=""><figcaption><p>Create a player hud widget on your player character and make sure a reference to it is passed onto the firearm.</p></figcaption></figure>

   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.

<figure><img src="/files/Fx56N7ROzFBZx8gKh9x7" alt=""><figcaption><p>Make sure to hook up the <code>Player Camera Input</code> function of the active firearm to the player XY mouse input.</p></figcaption></figure>

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.

{% hint style="info" %}
Important: If you're using your own player character setup, make sure to enable the actor tick for the BP\_FPS\_Firearm while they are held by the player. Otherwise, the recoil system will not work.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://tobias-w.gitbook.io/firearms-evolved/firearms-evolved/quick-start-guide.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
