PixPoly

Tutorial 08

Profiles: crouching (Crouch)

4:16

Profiles define complete locomotion sets for other postures. Example with Crouch: setting up the profile, switching profiles in Blueprint, entry transitions, a multiplayer fix, and a look at vehicle, swimming and flying profiles.

Chapters

  1. 0:00The Profiles tab
  2. 0:18Enabling the Crouch profile
  3. 0:32Switching profiles in Blueprint: Set Axis State
  4. 1:17Unreal’s native Crouch and the capsule
  5. 1:31In-game test
  6. 1:40Crouched movement
  7. 2:12Enter state and transition animations
  8. 2:49Multiplayer fix
  9. 3:37Vehicles and other profiles

The Profiles tab

The Profiles tab opens from the Window menu. It is a table in which each column is a locomotion profile — for example Crouch, for the crouched character.

Enabling the Crouch profile

Right-clicking the Crouch cell of the Unarmed row enables it. The Sections tab updates: you set up Crouch’s Forward mode exactly like the standing character’s, starting with the crouched Idle.

Switching profiles in Blueprint

Profile switching happens in the character’s Blueprint. With the Character Factory, the Crouch action is already set up, on the C key: it calls the Set Axis State function, which defines the profile to enable.

  1. 1Copy the profile name, Crouch, and paste it into the Value of the first Set Axis State node.
  2. 2To add this node elsewhere, drag off the Locomotion Component and search for Set Axis State.
  3. 3A None value returns to the default profile. With the Flip Flop, a first press switches to Crouch, a second one returns to the default profile.

Unreal’s native Crouch and the capsule

You also need to call Unreal’s native Crouch and Un Crouch functions on the character, and set the crouched capsule’s half-height (Crouched Half Height) in the Blueprint: 60 centimetres for the character in the video.

Crouched movement

With only the Idle, the character crouches but cannot move. So you set up the crouched run, with its forward starts (Start Position at 0.1) and its stops. In the Movement Settings, Use Data Asset then Autofill update speed, acceleration and deceleration.

Enter state and transition animations

Since version 1.4, the Enter row defines how a profile is entered. Its value is an interpolation time: at 1, the character takes one second to switch to Crouch.

You can also leave it at 0 and place a transition animation in the Enter cell: here, from standing to crouched. In the Default column, an Enter cell with the reverse animation handles the way back.

Multiplayer fix

The On Start Crouch and On End Crouch events call Notify Native Crouch Height Changed. Without them, in multiplayer, another player’s character sinks into the ground when crouching and floats when standing up.

Call this node once from On Start Crouch and once from On End Crouch, with Starting disabled. It has no effect on your own character: only on the ones you see without controlling them.

Vehicles and other profiles

A profile can also be used for vehicles: right-clicking the column header sets its type to Vehicle, and the Sections tab then offers a Drive mode, with a Blend Space or clips. You can create as many profiles as you need: swimming, flying, paragliding…

All tutorials