BP_LPAMG_PCH
Introduction
The Player Character Blueprint (BP_LPAMG_PCH) is the Blueprint that contains all the functionality related to the player character in the showcase.
This contains basically everything that you would need to modify or look into in relation to the asset’s showcases.
You can find the Player Character Blueprint at this path: LowPolyAnimatedModernGuns/Demo/Core/Pawns/BP_LPAMG_PCH
Private Variables
Aiming. This value is true when the character is aiming. This happens usually due to the player’s input.
Running. If true, it means the character is currently running. This happens usually due to the player’s input.
Switching. If true, it means the character is currently changing items in its hands. This happens usually due to the player’s input.
Holstered. If true, it means the character’s equipped item is currently holstered.
Crouching. If true, the character is currently crouching.
Jumping. If true, the character is currently jumping. This happens usually due to the player’s input.
Unarmed. This value gets set to true if the character is unarmed. This only really happens in very specific situations.
First Person. True if the player is currently viewing everything from first person.
Camera Animated. True if the player’s camera is attached to the character’s head bone, and is showing all the camera animations properly.
Offsetting Location. If true, the player is able to offset the location of the character’s weapon bone. If false, the player is able to offset the rotation.
Holding Button Fire. True while the player is holding the firing key.
Holding Button Aiming. True while the player is holding the aiming key.
Holding Button Toggle Skins. True while the player is holding the toggle skins key.
Holding Button Toggle Attachments. True while the player is holding the toggle attachments key.
Actor Weapon. Cached reference to the currently equipped item. This is usually a weapon, but it can also be some other item depending on the art pack!
Camera Offset Location. Location offset of the camera.
Target Camera Location. Target location at which the camera will be interpolated to.
Target Camera Rotation. Target rotation at which the camera will be interpolated to.
Locked In First Person. If true, the player is currently locked in the first person view, and is seeing the character from the animated viewpoint, and not from outside.
Last Time Fire. The last game time at which the player fired. This is important so we can calculate the fire rate properly.
Index Weapon. The index of the currently equipped item in the array of items.
Attachments Visible. True if the currently equipped item’s attachments are visible at the moment. This is important for weapons, so we can test what they look like without attachments.
Weapon Offset Standing Location. The location offset applied to the weapon bone while in the standing state.
Weapon Offset Standing Rotation. The rotation offset applied to the weapon bone while in the standing state.
Weapon Offset Aiming Location. The location offset applied to the weapon bone while in the aiming state.
Weapon Offset Aiming Rotation. The rotation offset applied to the weapon bone while in the aiming state.
Weapon Offset Running Location. The location offset applied to the weapon bone while in the running state.
Weapon Offset Running Rotation. The rotation offset applied to the weapon bone while in the running state.
Attachments Scale. The scale of the currently equipped item’s attachments.
First Person Montage Character Fire. The character’s cached firing montage to play for the first person perspective.
First Person Montage Character Holster. The character’s cached holster montage to play for the first person perspective.
First Person Montage Character Unholster. The character’s cached unholster montage to play for the first person perspective.
First Person Montage Character Reload. The character’s cached reload montage to play for the first person perspective.
First Person Montage Character Reload Empty. The character’s cached reload empty montage to play for the first person perspective.
First Person Montage Character Inspect. The character’s cached inspect montage to play for the first person perspective.
Third Person Montage Character Fire. The character’s cached fire montage to play for the third person perspective.
Third Person Montage Character Reload. The character’s cached reload montage to play for the third person perspective.
Third Person Montage Character Reload Empty. The character’s cached reload empty montage to play for the third person perspective.
Third Person Montage Character Inspect. The character’s cached inspect montage to play for the third person perspective.
Target Camera Offset. The location offset at which the camera should be positioned. This is very important for third person as moving the camera to different locations allows us to better show what the animations look like.
Index Camera Offset. Determines what index in the array of camera offsets we are currently at. This is meant to tell us exactly where the camera should be by making use of the offsets array.
First Person Montage Character Holster Quick. The character’s cached holster quick montage to play for the first person perspective.
First Person Montage Character Unholster Quick. The character’s cached unholster quick montage to play for the first person perspective.
Selected Glove Knife Skin. The exact combination of skins to apply to the arms as a camo and to the knife as well. This is super specific setup, and not very great for generic things, but we use it quite well for the demo.
Weapon Sounds. The data asset containing all the sounds to play for the equipped item. I realize this says “Weapon Sounds”, but we’ll use it for any items that the character can equip in the future, because it is awesome!
Tutorial Visible. This variable is set to true when the tutorial on screen is supposed to be visible, which only really happens when the player presses the tutorial key.
Movement Forward. Forward movement input value. For the most part this just keeps track of whether the player is pressing “W” or not.
Movement Backward. Backwards movement input value. For the most part this just keeps track of whether the player is pressing “S” or not.
Movement Left. Left movement input value. For the most part this just keeps track of whether the player is pressing “A” or not.
Movement Right. Right movement input value. For the most part this just keeps track of whether the player is pressing “D” or not.
Crosshair Size Multiplier. This is the value that the crosshair’s size will get multiplied by at any given time,
Last Crosshair Size Multiplier. This is the previous value for Crosshair Size Multiplier.
Next Increase Value Crosshair. Represents the next scale value for the crosshair to scale to.
Inspecting. This value is true if this pawn is currently inspecting its equipped item.
Editable Variables
Camera Speed Scroll. Speed at which the camera can be scrolled in or out to zoom. This naturally doesn’t do much when viewing things from the first person perspective, and only works when seeing things from outside.
Camera Distance Min. Minimum distance from the pawn/character at which the camera can be when looking at it from outside.
Camera Distance Max. Maximum distance from the pawn/character at which the camera can be when looking at it from outside.
Interpolation Speed Camera Location. Interpolation speed of the camera’s location. This basically just changes how smoothly the camera moves around.
Interpolation Speed Camera Rotation. Interpolation speed of the camera’s rotation. This basically just changes how smoothly the camera spins around.
Camera Crouching Offset. Location offset applied to the camera when the third person character is crouching. This is quite important because otherwise we see things from too high up.
Camera Sideways Offsets. Array of possible offsets that the camera can have when the player is testing the third person character animations. These are there so the player can better see all the animations from different angles.
Field Of View Default. The default field of view that gets applied to the player’s camera. We have this here mostly so we can have a reset button for the field of view. Other than that, we could have just set it on the camera at start and be done with it.
Character Montage Bop. One of the boop bop montages we play to add some cool motion at times!
Character Montage Boop. One of the boop bop montages we play to add some cool motion at times!
Holster Sequence Length Multiplier. This determines how the holster sequence’s length ends. That sounds weird, but basically if you set this to 0.5 the holster sequence will end in half of the time that it normally takes for it to end. That’s very important to make things work properly.
Unholster Sequence Length Multiplier. This determines how the unholster sequence’s length ends. That sounds weird, but basically if you set this to 0.5 the unholster sequence will end in half of the time that it normally takes for it to end. That’s very important to make things work properly.
Mesh First Person. The first person character mesh. We have this here instead of just setting it directly because we change it for the third person mesh at times.
Anim Instance Class First Person. The Animation Blueprint that we use for the first person character. We swap this along with the mesh when we change the character mesh.
Can Switch To Third Person Mesh. Setting this variable to true allows the player to change to the third person character mesh.
Mesh Third Person. The third person character mesh. We have this here instead of just setting it directly because we change it for the first person mesh at times.
Anim Instance Class Third Person. The Animation Blueprint that we use for the third person character. We swap this along with the mesh when we change the character mesh.
Skins. Array of possible character skins that the character can have applied to itself.
Offsetting Amplitude Location. The amplitude by which to offset the location of the weapon bone every time it gets offset.
Offsetting Amplitude Rotation. The amplitude by which to offset the rotation of the weapon bone every time it gets offset.
Array Class Weapons. Array of items to spawn when the game starts. These are the items that we’re showcasing for the specific art pack basically. And yes, we realize that the variable name is weapons. Life is hard.
Interface Class. The class of the player’s interface for this art pack.
Version Class. The class of the player’s version widget for this art pack.
Fidgets. Array of Animation Montage files that get played every once in a while over the base idle animation. We call these fidgets, as they are usually just the character fidgeting.
Fidget Delay Min. Minimum amount of time that has to pass before a new fidget animation can be played after playing the last one.
Fidget Delay Max. Maximum amount of time that has to pass before a new fidget animation can be played after playing the last one.
Functions
Increment Weapon Index. Increments the value of the Index Weapon variable while taking into account when it has reached the length of the Weapon Array and resetting to zero.
Decrement Weapon Index. Increments the value of the Index Weapon variable while taking into account when it has reached zero and resetting to the length of the Weapon Array.
Randomize Weapon Attachments. Randomizes the attachments equipped on the current item, which usually turns out to be a weapon.
Toggle Perspective. Toggles perspective from locked in first-person to rotating around the character. This works for both first-person and third-person.
Camera Attach To Animation. Attaches the camera to the animated parent.
Camera Attach To Normal. Attaches the camera to the normal parent.
First Person Unlock. Unlocks the camera from being on the character.
First Person Lock. Locks the camera to the character's head.
Get Weapon Socket Name. Returns the socket that a weapon should be attached to.
Offset Weapon. Offsets the weapon by a certain amount, both in location and rotation.
Stop Montages. Stops all montages going on at the same time.
Is Moving. This function returns true if the character is supposed to be moving. In all fairness, the character/pawn never really moves, as it doesn’t even have a movement component, but it does simulate movement via animation.
Get Equipped Weapon Sounds. Returns the data asset containing all the sounds that can be played for the current equipped item.
Try Spawn Weapon Sound. Tries to spawn a sound player for one of the equipped item sounds.
Try Stop Weapon Sound. Tries to stop a sound player for one of the equipped item sounds.
Try Spawn Weapon Sound Added. Tries to spawn a sound for the equipped item that plays over the other active sounds.
Play Running Sound. Starts playing the character’s running sound.
Add UI To Screen. Adds all the required interface elements to the screen. We made this into a function so we can do it at will and also remove them at will.
Try Stop Weapon Montage. Tries to stop the currently-playing montage on the equipped weapon.
Graphs
Event Graph. This is the main Event Graph that all blueprints in the Unreal Engine have.
Graph Input. This graph contains all the input-related events.
Graph Utility. This graph contains all the utility events that are built into the blueprint.
Graph Interfaces. This graph contains all implementations of interface functions that this blueprint needs.
Cached Graphs (CGraphs)
Input Action Fire Pressed. This graph contains all the logic that happens when the player presses the fire input button.
Input Action Reload Pressed. This graph contains all the logic that happens when the player presses the reload input button.
Input Action Unarmed Toggle Pressed. This graph contains all the logic that happens when the player presses the unarmed input button.
Input Action Reload Empty Pressed. This graph contains all the logic that happens when the player presses the reload empty input button.
Input Action Inspect Pressed. This graph contains all the logic that happens when the player presses the inspect input button.
Input Action Change Attachments Pressed. This graph contains all the logic that happens when the player presses the change attachments input button.
Input Action Aiming Pressed. This graph contains all the logic that happens when the player presses the aiming input button.
Input Action Throw Grenade Pressed. This graph contains all the logic that happens when the player presses the throw grenade input button.
Input Action Change Skin Pressed. This graph contains all the logic that happens when the player presses the change skin input button.
Input Action Holster Pressed. This graph contains all the logic that happens when the player presses the holster input button.
Input Action Knife Attack Pressed. This graph contains all the logic that happens when the player presses the knife attack input button.
Input Action Hide/ Show Attachments Pressed. This graph contains all the logic that happens when the player presses the hide/show attachments input button.
Input Action Change Weapon Last Pressed. This graph contains all the logic that happens when the player presses the last weapon input button.
Input Action Change Character Pressed. This graph contains all the logic that happens when the player presses the change character input button.
Input Action Change Camera Animation Pressed. This graph contains all the logic that happens when the player presses the change camera animation input button.
Input Action Change Weapon Next Pressed. This graph contains all the logic that happens when the player presses the next weapon input button.
Input Action Reset Offsets Pressed. This graph contains all the logic that happens when the player presses the reset offsets input button.
Input Action Sprint. This graph contains all the logic that happens when the player presses the sprinting input button.
Input Action Crouch. This graph contains all the logic that happens when the player presses the crouching input button.
Event Begin Play. Contains all the functionality that needs to be run at the start of the application.
Event Tick. Contains all the functionality that needs to be run every frame of the game.
Event Spawn Weapon. Contains all the logic needed to spawn a weapon, and gets run from an event with the exact same name.
Update Animation Data. Inside here is where we cache all the montages and other animations that we need when trying to play the different actions.
Event Try Play Fidget. Contains all the logic related to trying to play a fidget montage.
Set Up Timelines. Updates all values related to the Timelines in the blueprint. Basically takes care of setting up lengths, curves…etc
Last updated
Was this helpful?
