UNetworkPredictionPhysicsComponent

[UNetworkPredictionPhysicsComponent](API\Plugins\NetworkPrediction\UNetworkPredictionPhysicsCompone-)

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

NetworkPrediction

Header

/Engine/Plugins/Runtime/NetworkPrediction/Source/NetworkPrediction/Public/NetworkPredictionPhysicsComponent.h

Include

#include "NetworkPredictionPhysicsComponent.h"

Syntax

[UCLASS](Programming/UnrealArchitecture/Reference/Classes#classdeclaration)(BlueprintType, Meta=(BlueprintSpawnableComponent))
class UNetworkPredictionPhysicsComponent : public UActorComponent

Remarks

UNetworkPredictionPhysicsComponent

This is a component that will register a FGenericPhysicsModelDef and bind to the first UPrimitiveComponent found in the parent actor. That is - there is NO backing NetworkPrediction simulation/gameplay code. This will always be SimulatedProxy and does not support any of the AP<>Server communication that UNetworkPredictionComponent.

To fully emphasize: this is for STAND ALONE physics objects that want to use NP's fixed tick services. It is NOT for "any NP object that uses physics". A vehicle that can be controlled by a client needs to use (or model after) UNetworkPredictionComponent.

Even then, it is just sort of an example. An extra component may not be the best way to use this. It may make more sense to just put the important bits on your actor class and set the exact UpdatedPrimitive you want (really PhysicsActorHandle is all that matters!)

Variables

Name Description

Protected variable UProperty Transient, Replicated

FNetworkPredict...

 

NetworkPredictionProxy

Proxy to interface with the NetworkPrediction system.

Protected variable UProperty Transient, Replicated

FReplicationPro...

 

ReplicationProxy

Protected variable UProperty

UPrimitiveCompo...

 

UpdatedPrimitive

Constructors

Functions

Name Description

Protected function

bool

 

CheckOwnerRoleChange()

Helper: Checks if the owner's role has changed and calls InitializeForNetworkRole if necessary.

Protected function

FReplication...

 

GetReplicationProxies()

Protected function Virtual

void

 

InitializeForNetworkRole

(
    ENetRole Role,
    const bool bHasNetConnection
)

Finalizes initialization when NetworkRole changes. Does not need to be overridden.

Protected function Virtual

void

 

InitializeNetworkPredictionProxy()

Classes must initialize the NetworkPredictionProxy (register with the NetworkPredictionSystem) here. EndPlay will unregister.

Protected function Virtual

void

 

SetPrimitiveComponent

(
    UPrimitiveComponent* NewUpdate...
)

Overridden from UActorComponent

Name Description

Public function Virtual

void

 

EndPlay

(
    const EEndPlayReason::Type EndPlayR...
)

Ends gameplay for this component.

Public function Virtual

void

 

InitializeComponent()

Initializes the component.

Public function Virtual

void

 

PreReplication

(
    IRepChangedPropertyTracker& Change...
)

Called on the component right before replication occurs

Overridden from UObject

Name Description

Public function Virtual

void

 

PreNetReceive()

Called right before receiving a bunch

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss