![]() ![]() ![]() In the actor's constructor, make sure you have the bReplicates flag set to true:ĪActor::AActor( const class FPostConstructInitializeProperties & PCIP ) : Super( PCIP ) Void AActor::GetLifetimeReplicatedProps( TArray & OutLifetimeProps ) const In the implementation of the actor class, you need to implement the GetLifetimeReplicatedProps function: In the header of the actor class where the property is defined, you need to make sure you have the replicated keyword as one of the parameters to the UPROPERTY declaration: To replicate a property, you need to do a few things: For example, if an integer property rapidly changes its value from 100 to 200, and then to 300, the client will eventually receive an update with the value of 300, but there is no guarantee that the client will know about the change to 200. This means that the property of the client version of the Actor will eventually reflect the value on the server, but the client will not necessarily receive notification of every individual change that happens to a property on the server. If the server's copy of the property does not change very often, it could be a long time before the client receives a correction.Īctor property replication is reliable. The value will continue to differ from the server's value until the next time the server detects a change and sends an update. Changing a replicated variable's value on the client is not recommended. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |