UE4 VR局域网(二)基础知识

本文详细介绍了UE4中VR应用的局域网同步技术,包括引用类型的复制、组件的同步策略、静态网格体的同步方法、变量与事件的同步通知,以及replicate属性下的运动同步功能。强调了在C++中使用RPC函数的注意事项和不同关联性设置对同步的影响,对于优化网络性能和确保多客户端一致性至关重要。
摘要由CSDN通过智能技术生成

复制

1.引用类型可以复制。(实际传递的是引用对象的ID(FNetworkGUID)

2.大部分组件不支持复制。

 

 

1.使用组件的set is replicated时,可以用RepNotify服务器和客户端执行相同的同步后的事件):

I managed to resolve the issue by getting rid of the Set Is Replicated nodes and making the variable of DeltaRELCombine (the one which is set after calculations and determines where the new StaticMesh should be placed) RepNotify. In the On Rep function I implemented the StaticMeshComponent addition so that it executes both on the client and the server in the same way. I also had to play with the dynamic material instances a bit as they where replicated only upon some significant events.

 

2.同步static mesh

 https://answers.unrealengine.com/questions/21524/replicate-static-mesh.html  //利用创建static meshactor 解决。

 

3.变量同步,事件通知

 例:

//声明示例

UPROPERTY(Transient, Replicated)

TArray<class AShooterWeapon*> Inventory;

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值