UCharacterMovementComponent::SetWalkableFloorAngle
#include "GameFramework/CharacterMovementComponent.h"
Access: public
Specifiers: UFUNCTIONBlueprintCallable
Description
Sets the maximum slope angle, in degrees, that the character can walk on, and recomputes WalkableFloorZ to match.
Caveats & Gotchas
- • The input is clamped to [0, 90] degrees rather than rejected, so an out-of-range value silently becomes the nearest valid angle instead of erroring.
- • Overwrites WalkableFloorZ as a side effect (computed as cos of the angle in radians) — calling SetWalkableFloorZ() afterward expecting both values to hold independently will surprise you.
Signature
void SetWalkableFloorAngle(float InWalkableFloorAngle) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| InWalkableFloorAngle | float | New maximum walkable slope angle in degrees; clamped to [0, 90]. | — |
Return Type
void Example
Loosen the slope limit for a heavy character C++
void AMyCharacter::BeginPlay()
{
Super::BeginPlay();
GetCharacterMovement()->SetWalkableFloorAngle(60.f);
} See Also
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?