콘텐츠로 이동

How-to Guides

이 콘텐츠는 아직 번역되지 않았습니다.

All steps start in your character Blueprint, with Character Movement selected in the Components panel. Search the Details panel for the setting name, or look under the categories starting with VAC |.

Presets are created as in Getting Started, 1.3.

  1. Create a preset named Swim: Shape Capsule, Extent 34 / 34 / 88, Rotation Y (Pitch) 90.

  2. In the Swim preset, click + next to Allowed Movement Modes and choose Swimming. Swim is now only used while swimming.

  3. Find Movement Mode Presets, click +, set the key to Swimming and the value to Swim.

    Character Movement Details: Swim preset with Allowed Movement Modes = Swimming, and Movement Mode Presets with Swimming -> Swim.

  4. In your level, add a water area: Place Actors → Volumes → Physics Volume, scale it, and tick Water Volume in its Details.

  5. Press Play and walk into the volume. The shape lies down while swimming and stands up again when you leave the water.

    Viewport with show Collision: character swimming in the Physics Volume with the lying Swim capsule.

The same works for Flying or any other movement mode. A preset you select from Blueprint always wins over a movement mode preset.

  1. Create a preset named Sit: Shape Capsule, Extent 34 / 34 / 55.

  2. Find Custom Movement Mode Presets, click +, set the key to 1 and the value to Sit.

    Character Movement Details: Custom Movement Mode Presets with 1 -> Sit, and the Sit preset (Capsule, Extent 34 / 34 / 55).

  3. In the Event Graph, on your sit input: Get Vertex Character Movement → Can Fit Collision Shape Preset with Sit, then a Branch.

  4. From True: drag from Get Vertex Character Movement, add Set Movement Mode with New Movement Mode = Custom and New Custom Mode = 1, and start your sit animation.

  5. To stand up: Can Fit Collision Shape Preset with Default (the normal capsule), then a Branch. From True: Set Movement Mode with New Movement Mode = Walking, and stop the sit animation.

    Event Graph: sit input to Can Fit (Sit) -> Branch -> Set Movement Mode (Custom, 1); stand input to Can Fit (Default) -> Branch -> Set Movement Mode (Walking).

The character does not move while in a custom movement mode, which is what you want for sitting. The shape stays on the floor while it gets lower.

Limit speed, jumping and crouching per preset

Section titled “Limit speed, jumping and crouching per preset”
  1. Expand a preset (for example Crawl).

  2. Set Max Speed (for example 150). 0 means no limit. It also caps sprinting.

  3. Untick Can Jump and/or Can Crouch if the preset should not allow them.

    Crawl preset expanded: Max Speed 150, Can Jump and Can Crouch unticked.

These rules apply as soon as the preset is selected. Do not block jump or speed with your own Blueprint checks for this: the preset rules run inside the movement prediction, so they cause no corrections in multiplayer.

Use the engine’s Crouch and Un Crouch nodes as usual. They work with every shape: the current shape is lowered to Crouched Half Height, and standing up waits until there is room. To stop a preset from crouching, untick Can Crouch on it.

Tilt the shape from the animation (swimming, flying)

Section titled “Tilt the shape from the animation (swimming, flying)”
  1. Create a preset (for example Swim from the water guide above) and keep Allow Auto Tilt ticked (on by default).

  2. Make sure that preset is used (selected from Blueprint, or through Movement Mode Presets).

  3. Tick Auto Tilt From Mesh (category VAC | Auto Tilt).

  4. If your skeleton is not the Unreal Mannequin, set Auto Tilt Start Bone and Auto Tilt End Bone to its pelvis and head bone names.

    Character Movement Details: VAC | Auto Tilt category with Auto Tilt From Mesh ticked and the default bones, dead zone, step and max angle.

  5. Press Play and swim. The shape follows the body’s lean in steps of Auto Tilt Step (15°). Leans smaller than Auto Tilt Dead Zone (25°) are ignored.

    Viewport with show Collision: swimming character leaning, the capsule tilted to match the body.

The normal capsule never tilts, so leaning animations on land do not tip the character. To switch auto tilt at runtime, use Set Auto Tilt From Mesh.

  1. Expand a preset (for example Crawl) and tick Align To Floor.

  2. Press Play and crawl onto a ramp. The shape tilts in 5° steps with the slope and the mesh tilts smoothly with the ground.

    Viewport with show Collision: crawling character on a ramp, capsule and mesh both tilted with the slope.

In the air the shape and mesh return to level. Leave it unticked on presets that do not need it (it adds a few traces while walking).

Example: the player stops crawling inside a low tunnel. The character keeps crawling and stands up by itself at the tunnel exit.

  1. In the crawl toggle from Getting Started, connect the False pin of the Branch to Set Collision Shape Preset with Default anyway. The shape waits until there is room.

  2. Keep IsCrawling true on that path so the crawl animation keeps playing.

  3. In the Components panel, select Character Movement. At the bottom of the Details panel, under Events, click + next to On Collision Shape Reached.

  4. From the new event: Branch with Preset == Default. From True: Set IsCrawling to false.

    Event Graph: crawl toggle Branch False wired to Set Collision Shape Preset (Default); On Collision Shape Reached -> Branch (Preset == Default) -> Set IsCrawling false.

On Collision Shape Reached fires once when the shape has fully arrived. Has Reached Collision Shape returns the same information at any time.

React to preset changes with Gameplay Tags

Section titled “React to preset changes with Gameplay Tags”
  1. Go to Project Settings → Gameplay Tags, click Add New Gameplay Tag and add a tag, for example State.Prone.

  2. In the Crawl preset, add State.Prone to Tags.

    Project Settings, Gameplay Tags with State.Prone added; Crawl preset with State.Prone in Tags.

  3. Anywhere you have the character: Get Vertex Character Movement → Has Collision Shape Preset Tag with State.Prone returns true while crawling. This works on every machine, including other players’ characters.

  4. To run logic once per change, add the On Collision Shape Preset Changed event (same way as in the guide above). It gives the old and new preset names and tags.

    Event Graph: Has Collision Shape Preset Tag (State.Prone) feeding a Branch, and the On Collision Shape Preset Changed event with its Old/New Preset and Tags pins.

Use any shape on AI or in single-player games

Section titled “Use any shape on AI or in single-player games”

Players in multiplayer must use presets. For AI characters, single-player games and the listen-server host, you can set any shape directly:

  1. Add Make Box Shape (or Make Capsule Shape / Make Sphere Shape) and set its sizes. Box Half Extent is half the size on each axis.

  2. Get Vertex Character Movement → Set Collision Shape with that shape.

  3. Reset Collision Shape returns to the normal capsule.

    AI character Event Graph: Make Box Shape (Half Extent, Rotation) -> Set Collision Shape, and Reset Collision Shape.

On a character controlled by a remote player, Set Collision Shape is refused and prints a warning in the Output Log.