ACharacter::SetBase
#include "GameFramework/Character.h"
Access: public
Specifiers: virtual
Description
Sets the component the character is standing on, allowing CharacterMovementComponent to follow dynamic objects. Called automatically by the movement component; rarely needed in game code.
Caveats & Gotchas
- • Calling this directly bypasses the movement component's usual base-change logic. Prefer letting CharacterMovementComponent manage this automatically.
- • When the base is a skeletal mesh and BoneName is invalid, the character may not correctly follow the bone's motion — validate bone names before passing them.
Signature
virtual void SetBase(UPrimitiveComponent* NewBase, const FName BoneName = NAME_None, bool bNotifyActor=true) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| NewBase | UPrimitiveComponent* | The primitive component the character is now standing on. Pass nullptr to clear the base. | — |
| BoneName | const FName | Bone name on a skeletal mesh base, or NAME_None for non-skeletal or invalid bones. | NAME_None |
| bNotifyActor | bool | If true, calls BaseChange() after updating the base. | true |
Return Type
void Example
Override base after teleport C++
// Rarely needed — CharacterMovement handles this automatically.
// Example: force-clear the base after teleporting the character.
SetBase(nullptr); Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?