同步位置放大1000倍取整

This commit is contained in:
janing
2025-12-18 13:43:28 +08:00
parent 637978357f
commit 4b3b94a450
3 changed files with 18 additions and 9 deletions

View File

@@ -107,10 +107,13 @@ export class World {
return;
}
const x = this.localPlayer.position.x / 1000
const y = this.localPlayer.position.y / 1000
// 实例化玩家节点
this.localPlayerNode = instantiate(this.playerPrefab);
this.localPlayerNode.name = `Player_${this.localPlayer.id}_Local`;
this.localPlayerNode.setPosition(this.localPlayer.position.x, 0, this.localPlayer.position.y);
this.localPlayerNode.setPosition(x, 0, y);
this.worldRoot.addChild(this.localPlayerNode);
// 创建本地玩家控制器