APawn::TeleportSucceeded
#include "GameFramework/Pawn.h"
Access: public
Specifiers: virtualoverride
Description
Called after a successful teleport via SetActorLocation or TeleportTo. Notifies the movement component to update its internal location cache and reset any accumulated velocity from the previous position.
Caveats & Gotchas
- • Always check bIsATest before performing any state changes — the engine calls TeleportSucceeded() with bIsATest=true during collision sweep tests where no actual movement has occurred.
- • The base implementation notifies the movement component; if you have a custom movement component that caches the pawn's last known position, you must update it here or the component may compute incorrect deltas on the next tick.
Signature
ENGINE_API virtual void TeleportSucceeded(bool bIsATest) override; Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| bIsATest | bool | If true, the teleport was a sweep test and not a real teleport — the pawn should not respond to test calls. | — |
Return Type
void Example
Override to reset a velocity-based effect after teleport C++
void AMyPawn::TeleportSucceeded(bool bIsATest)
{
Super::TeleportSucceeded(bIsATest);
if (!bIsATest)
{
// Clear any speed-trail VFX that was based on previous velocity
SpeedTrailComponent->Deactivate();
}
} See Also
Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?