UCharacterMovementComponent::SetWalkableFloorZ
#include "GameFramework/CharacterMovementComponent.h"
Access: public
Specifiers: UFUNCTIONBlueprintCallable
Description
Sets the minimum Z component of a walkable surface's normal, and recomputes WalkableFloorAngle to match.
Caveats & Gotchas
- • Clamped to [0, 1]; a value of 1 means only perfectly flat floors are walkable, while 0 allows slopes all the way up to vertical.
- • Overwrites WalkableFloorAngle as a side effect, computed as acos(Z) in degrees — don't call SetWalkableFloorAngle() afterward expecting both to persist independently.
Signature
void SetWalkableFloorZ(float InWalkableFloorZ) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| InWalkableFloorZ | float | New minimum walkable-surface normal Z component; clamped to [0, 1]. | — |
Return Type
void Example
Set the walkable limit using the Z normal directly C++
void AMyCharacter::BeginPlay()
{
Super::BeginPlay();
// Roughly equivalent to a 45 degree slope limit.
GetCharacterMovement()->SetWalkableFloorZ(0.707f);
} See Also
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?