Skip to content

Commit 583383f

Browse files
committed
up
1 parent 872302f commit 583383f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Assets/Scripts/u3d_scripts/GameEntity.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,8 @@ void Update ()
224224

225225
float dist = 0.0f;
226226

227+
// 如果isOnGround为true,服务端同步其他实体到客户端时为了节省流量并不同步y轴,客户端需要强制将实体贴在地面上
228+
// 由于这里的地面位置就是0,所以直接填入0,如果是通过navmesh不规则地表高度寻路则需要想办法得到地面位置
227229
if(isOnGround)
228230
{
229231
dist = Vector3.Distance(new Vector3(destPosition.x, 0f, destPosition.z),

0 commit comments

Comments
 (0)