AActor::PostNetReceiveVelocity
#include "GameFramework/Actor.h"
Access: public
Specifiers: virtualENGINE_API
Description
Called on simulated proxies when a new velocity is received from the ReplicatedMovement struct. Not called when physics simulation is active on the client — use PostNetReceivePhysicState in that case.
Caveats & Gotchas
- • This is NOT called for actors using simulated physics (bRepPhysics=true). For those actors, PostNetReceivePhysicState handles both location and velocity.
- • The function is called as part of PostNetReceiveLocationAndRotation processing, so the actor's location may also have changed in the same replication batch.
- • Overriding this without calling Super can break the default velocity smoothing applied by movement components on simulated proxies.
Signature
ENGINE_API virtual void PostNetReceiveVelocity(const FVector& NewVelocity); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| NewVelocity | const FVector& | The newly received velocity from the ReplicatedMovement struct. | — |
Return Type
void Example
Applying received velocity to a custom movement system C++
void AMyActor::PostNetReceiveVelocity(const FVector& NewVelocity)
{
Super::PostNetReceiveVelocity(NewVelocity);
// Forward the replicated velocity to our custom mover
if (CustomMoverComponent)
{
CustomMoverComponent->SetReplicatedVelocity(NewVelocity);
}
} Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?