Navigation
API > API/Plugins > API/Plugins/NetworkPrediction
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- UActorComponent
- UNetworkPredictionPhysicsComponent
- UMockPhysicsGrenadeComponent
References
Module | NetworkPrediction |
Header | /Engine/Plugins/Runtime/NetworkPrediction/Source/NetworkPrediction/Public/NetworkPredictionPhysicsComponent.h |
Include | #include "NetworkPredictionPhysicsComponent.h" |
Syntax
UCLASS&40;BlueprintType, Meta&61;&40;BlueprintSpawnableComponent&41;&41;
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
Type | Name | Description | |
---|---|---|---|
![]() ![]() ![]() |
FNetworkPredictionProxy | NetworkPredictionProxy | Proxy to interface with the NetworkPrediction system. |
![]() |
FPhysicsActorHandle | PhysicsActorHandle | |
![]() ![]() ![]() |
FReplicationProxy | ReplicationProxy | |
![]() ![]() |
TObjectPtr< UPrimitiveComponent > | UpdatedPrimitive |
Constructors
Type | Name | Description | |
---|---|---|---|
![]() |
Functions
Type | Name | Description | |
---|---|---|---|
![]() |
bool | Helper: Checks if the owner's role has changed and calls InitializeForNetworkRole if necessary. | |
![]() |
FReplicationProxySet | ||
![]() ![]() |
void | InitializeForNetworkRole
(
ENetRole Role, |
Finalizes initialization when NetworkRole changes. Does not need to be overridden. |
![]() ![]() |
void | Classes must initialize the NetworkPredictionProxy (register with the NetworkPredictionSystem) here. EndPlay will unregister. | |
![]() ![]() |
void | SetPrimitiveComponent
(
UPrimitiveComponent* NewUpdatedComponent |
Overridden from UActorComponent
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
void | EndPlay
(
const EEndPlayReason::Type EndPlayReason |
Ends gameplay for this component. |
![]() ![]() |
void | Initializes the component. | |
![]() ![]() |
void | PreReplication
(
IRepChangedPropertyTracker& ChangedPropertyTracker |
Called on the component right before replication occurs |
Overridden from UObject
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
void | Called right before receiving a bunch |