Categories
Advanced and Experimental 3D computer Animation Techniques Project 2

Week 3 Write character and weapon blue print in Unreal engine

This week, I completed the following tasks in the character blueprint:

  • Set up footstep sounds
  • Added mouse input for aiming down sights
  • Created a transition to zoom the head during aiming
  • Adjusted walking speed while aiming
  • Added depth of field effect when aiming
  • Set footstep sounds specifically for aiming movement
  • Created the weapon blueprint
  • Wrote a custom event for weapon firing
  • Added a weapon state machine
  • Added weapon sound effects, bullet effects, and reload effects
  • Implemented bullet hit effects
  • Created a function to count bullets
  • Built the reload blueprint
  • Added natural bullet spread
  • Added recoil effect when firing
  • Added bullet glow effects

This week, my main focus was still on blueprint scripting. Once the character and enemy blueprints are done, I can just drag them into the map and use them directly. Although there are many follow-up steps afterward, the blueprints are definitely the top priority.

After finishing them, I’ll move on to reworking some model textures, building the scenes, creating the UI and main menu, and finally packaging the game.

Last week’s recording wasn’t very clear, and Windows Game Bar can’t capture multiple windows well.

Especially when I opened the blueprint editor, it kept recording the main window—pretty awkward!

This week, I found a recording software called OBS Studio, and I’ve discovered it works really well.

Set up footstep sounds:

I selected the audio files and created a single cue. Then, I added an audio modulator to unify the pitch and volume across these sounds, while also introducing random variations in pitch and volume. This way, when played back, the audio feels much more dynamic and natural:

Then, I went back to the animation asset and added a “Notify” — “Play Sound” — selecting the sound cue I just created.

Added mouse input for aiming down sights

Similar to before, I added mouse input, set it up as IA_focus (for aiming function), and linked it inside the character blueprint. This lets me control the focus with the mouse smoothly.

I used a timer to make the aiming zoom effect transition more smoothly. This approach will also come in handy later for toggling the flashlight and handling other action transitions.

Adjusted walking speed while aiming:

In the speed calculation function, I added a condition that if the character is aiming, the selected float value becomes 150(150 for the speed of walk with aiming).

Then I add blueprints for the weapon, cause there are some functions like reload ammo and ammo calculation, I need to split these from character blueprint, otherwise, it will be mass.

Then, in the weapon blueprint, attach (or spawn) the weapon to the character’s arm.

In the weapon blueprint, I set up the following event icons: fire_weapon, change bullets, and recoil.

In fire_weapon, I configured three states: start firing, firing, and stop firing. Then I used play animation montage to connect the animation assets to each of these states.

The rest of the operations are all shown in my screen recording:

Leave a Reply

Your email address will not be published. Required fields are marked *