ACharacter::SetIsCrouched
#include "GameFramework/Character.h"
Access: public
Description
Directly sets the `bIsCrouched` replicated flag and marks it dirty for replication. Intended for use by CharacterMovementComponent when it commits a crouch or un-crouch; game code should use Crouch()/UnCrouch() instead.
Caveats & Gotchas
- • Calling SetIsCrouched(true) does not resize the capsule or reposition the mesh — those side effects are performed by CharacterMovementComponent's Crouch() path. Bypassing Crouch() will cause the character to appear crouched without the correct collision geometry.
- • This function marks bIsCrouched dirty for replication; calling it every tick will generate unnecessary network traffic.
Signature
ENGINE_API void SetIsCrouched(const bool bInIsCrouched); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| bInIsCrouched | const bool | New crouched state to apply. | — |
Return Type
void Example
Called by CharacterMovementComponent internally (illustrative) C++
// Inside UCharacterMovementComponent::Crouch():
if (CharacterOwner)
{
CharacterOwner->SetIsCrouched(true);
// ... capsule resize and mesh adjustment follow
} Tags
Version History
Introduced in: 5.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?