Memuat
Memuat
Watch every step above performed live, with English narration.
0 plays
Class book
Page 1 / 22
Cover: Unreal Engine 5 Third Person Shooter Game Part 2 - Weapons & Shooting
Click a page or use ◀ ▶ to turn · swipe on mobile · to enlarge
Want to go deeper?
Join one of our courses or ask us directly on WhatsApp.
Picked from the software, topic, and level of “Unreal Engine 5 Class: Third Person Shooter Game Part 2 - Weapons & Shooting”.
Other ways we can help with Unreal Engine.
Learn with a mentor
Scheduled Game Development courses with live guidance and a certificate.

Course/Training Unreal Engine — Procedural Animation for Humans in Unreal Engine 5
★ 5.0 (60)

Course/Training Unreal Engine — Training Unreal Engine Master Class Selama 3 Hari - Kelas 2
★ 5.0 (7)

Course/Training: Unreal Engine 5
★ 5.0 (7)
Have it built for you
No time to learn Unreal Engine? Our team can do the project for you.

Development Service: Unreal Engine — Unreal Engine 4 – Build Your First Game with UE4!!
★ 5.0 (12)

Development Service: Unreal — Unreal Engine 5 Blueprints: Multiplayer Shooter (FPS)
★ 5.0 (10)

Development Service: Blender — Blender Character Design Master for Unity & Unreal Engine
★ 5.0 (9)
Get notified about new Unreal Engine classes
At most one email a week. Unfollow anytime with one click.
The full narration of this video. The current sentence is highlighted while the video plays; click any sentence to jump there.
In this part 2, our character will hold a rifle, aim, shoot with sound, count ammunition, and be able to reload. All done with blueprints, no coding required. Hello, welcome back to Cerdas Inovasi Digital. We continue the TPS Shooter project from part 1. Now we add a weapon and shooting system. Let's start.
First, we need a weapon model. In the content browser, click Add, then select Add Feature or Content Pack.
Select the First Person package, then click Add to Project. This package is free from Unreal and contains rifle, pistol, and shooting sound models.
Open the Weapons folder. Here we have Rifle, Pistol, and Grenade Launcher. We will use the Rifle along with its mesh.
Now we set up the animation so the character holds the rifle. Find and open ABP Underscore Unarmed, which is the Animation Blueprint of the character.
Double-click Anim Grab in the My Blueprint panel to open the animation graph.
Right-click, then add a node Layered Blend per bone. This node blends two animations based on body bone parts.
Connect the output of Control Rig to Base Pose, then the output of Layered Blend to Output Pose.
From Pin Blend Poses 0, drag and select the animation MF Underscore Refle Underscore Idle Underscore ADS.
This is the pose holding the rifle while aiming.
Select the node Layered Blend per bone, then in the details panel, check Mass Space Rotation Blend, so that the upper body rotation follows the aiming direction.
On the setup screen, add a Branch Filter and fill the bone name with Spine Underscore 01. This means starting from the spine upwards uses the rifle pose, While the legs still use the running animation.
Click Compile. Check the preview window, the upper body is now in the position of holding the rifle. Save and close the Animation Blue Apprint.
Now we will create a shooting button.
In the input folder, Actions, create two new input actions, IA Underscore Shoot and IA Underscore Reload. Then click Save All.
Open IMC Underscore Default, where we map the buttons.
Add a new mapping, select IA Underscore Shoot, then select the left mouse button, which is the left click. Add another mapping for IA Underscore Reload, using the R key on the keyboard.
Save the input mapping and close the window.
Next, open the Blue Apprint character, BP Underscore Third Person Character.
Select the Mesh Component, click Add, select Skeletal Mesh, and name it weapon. This component will become the rifle held by the character.
In the Skeletal Mesh Asset, select SKM Underscore Rifle. In the Parent Socket, select Handgrip Underscore R Socket, which is already prepared in the character's right hand, so the rifle fits directly into the grip.
Open the Viaport tab. The rifle is already in the character's hand with the correct position.
Now create a Variable for Ammunition. Click the plus sign on Variables, name it ammunition, then change its type to integer, which is a whole number. Click Compile, then set the default value of ammunition to 30 bullets.
For neatness, create a new function specifically named Shoot.
Right-click and add an event IA Underscore Shoot.
From the Started pin, create a Branch node. The condition is, ammunition is greater than 0. So the character can only shoot if there are bullets left. If True, add a node for Damage Int from the Ammunition Variable.
Each shot reduces ammunition by 1.
Add Play Sound at Location, then select the built-in gunshot sound from the First Person package.
We take the sound location from the end of the barrel. Attach the weapon component, then Get Socket Location with the name Socket Musle.
Add another node Trace By Channel. This is an invisible line that detects what gets hit by the shot. We enable Draw The Book Type 4 Duration so the line is visible when trying.
The start point of the line is the camera position. Attach Follow Camera, then Gateway Location, and connect to Start.
The end point is the camera position plus the camera's forward direction multiplied by 5000. Use Gate Forward Factor, Multiply, and Add, then connect to End.
Add Print String and connect to the Ammunition Variable, so the remaining bullets are displayed on screen.
For Reload, add the event IA underscore Reload, then set ammunition back to 30.
Click Compile and Save, close the Blueprint, then save all with Save All.
It's time to try it out. Press Play. Hold right-click to aim, left-click to shoot. Notice the shooting line, the red dot where the bullet hits the target, and the ammunition count decreasing. Press R to Reload.
Done. Our character is now holding a rifle and can shoot. In part 3, we will build the combat arena environment. Don't forget to subscribe, like, and share. Goodbye. Want to master game development with Unreal Engine? Cerdas Inovasi Digital opens a complete Unreal Engine course, game development services and 3D character creation as well as selling ready-to-use project files. Contact our WhatsApp or visit cerdasinovasidigital.com
Type a question or keyword; we find the part of this episode that explains it and jump the video there.
Notes are saved with the current video time and are only visible to you.
Stuck on a step? Ask here; the instructor and other learners can answer.
No questions yet.

Cerdas Inovasi Digital Team
Software developers, BIM & 3D engineers, and AI practitioners
We build software, BIM models, games and AI automations for clients every day, and turn that hands-on work into step-by-step classes: every step is shown on screen and comes with a PDF guide you can keep.
See our clients →