接入ResLogin.otherPlayers
This commit is contained in:
@@ -40,8 +40,8 @@ export class RemotePlayer {
|
||||
this.playerName = playerName;
|
||||
const x = position.x / 1000
|
||||
const y = position.y / 1000
|
||||
this.currentPosition.set(x, 0, y);
|
||||
this.targetPosition.set(x, 0, y);
|
||||
this.currentPosition.set(x, y, 0);
|
||||
this.targetPosition.set(x, y, 0);
|
||||
|
||||
// 获取 RoleController 组件
|
||||
this.roleController = this.playerNode.getComponentInChildren(RoleController);
|
||||
@@ -79,7 +79,7 @@ export class RemotePlayer {
|
||||
|
||||
// 计算朝向
|
||||
if (distance > 0.01) {
|
||||
const targetAngle = Math.atan2(direction.x, -direction.z) * (180 / Math.PI);
|
||||
const targetAngle = Math.atan2(direction.x, -direction.y) * (180 / Math.PI);
|
||||
this.playerNode.setRotationFromEuler(0, targetAngle, 0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user