Navigation
API > API/Plugins > API/Plugins/NetworkPrediction
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!)
| Name | UNetworkPredictionPhysicsComponent |
| Type | class |
| Header File | /Engine/Plugins/Runtime/NetworkPrediction/Source/NetworkPrediction/Public/NetworkPredictionPhysicsComponent.h |
| Include Path | #include "NetworkPredictionPhysicsComponent.h" |
Syntax
UCLASS (MinimalAPI, BlueprintType, Meta=(BlueprintSpawnableComponent))
class UNetworkPredictionPhysicsComponent : public UActorComponent
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UActorComponent → UNetworkPredictionPhysicsComponent
Implements Interfaces
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UNetworkPredictionPhysicsComponent() |
NetworkPredictionPhysicsComponent.h |
Functions
Public
Overridden from UActorComponent
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void EndPlay
(
const EEndPlayReason::Type Reason |
NetworkPredictionPhysicsComponent.h | ||
virtual void InitializeComponent() |
NetworkPredictionPhysicsComponent.h | ||
virtual void PreReplication
(
IRepChangedPropertyTracker& ChangedPropertyTracker |
NetworkPredictionPhysicsComponent.h |
Overridden from UObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void PreNetReceive() |
NetworkPredictionPhysicsComponent.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool CheckOwnerRoleChange() |
Helper: Checks if the owner's role has changed and calls InitializeForNetworkRole if necessary. | NetworkPredictionPhysicsComponent.h | |
FReplicationProxySet GetReplicationProxies() |
NetworkPredictionPhysicsComponent.h | ||
virtual void InitializeForNetworkRole
(
ENetRole Role, |
Finalizes initialization when NetworkRole changes. Does not need to be overridden. | NetworkPredictionPhysicsComponent.h | |
virtual void InitializeNetworkPredictionProxy() |
Classes must initialize the NetworkPredictionProxy (register with the NetworkPredictionSystem) here. EndPlay will unregister. | NetworkPredictionPhysicsComponent.h | |
virtual void SetPrimitiveComponent
(
UPrimitiveComponent* NewUpdatedComponent |
NetworkPredictionPhysicsComponent.h |