[0]官方Demo摇杆控制有bug

在官方的3D角色控制Demo中,如果ide选择了视网膜画布模式,摇杆就没办法控制角色正确地行走。
 
 
请问如果我想勾选使用视网膜画布模式,这种情况下要怎么让角色正确行走的呢?
微信截图_20231013170308.png 微信截图_20231013170243.png
已邀请:

layabox

赞同来自:

手机浏览器上黑屏的问题,我这边没能重现。
 
不过摇杆的问题,在视网膜模式下,确实是存在
 
你注释或删除一下,Roker.ts里的rockerMove方法里的如下代码:
 
        this._currentMouse.x = Math.round(e.touchPos.x / Laya.stage.clientScaleY);
this._currentMouse.y = Math.round(e.touchPos.y / Laya.stage.clientScaleY);
this.currRockerbox.globalToLocal(this._currentMouse, false);

改为如下方式:
       // this._currentMouse.x = Math.round(e.touchPos.x / Laya.stage.clientScaleY);
// this._currentMouse.y = Math.round(e.touchPos.y / Laya.stage.clientScaleY);
// this.currRockerbox.globalToLocal(this._currentMouse, false);

this._currentMouse.x = e.stageX;
this._currentMouse.y = e.stageY;
this.currRockerbox.globalToLocal(this._currentMouse, false);
this._currentMouse.x /= Laya.stage.clientScaleY;
this._currentMouse.y /= Laya.stage.clientScaleY;

感谢反馈,我们会在3.0.7里修复好。
 

1697187378用户

赞同来自:

另外视网膜画布模式在手机浏览器中黑屏。

layaAir小孟

赞同来自:

好的,问题已记录,感谢反馈

该问题目前已经被锁定, 无法添加新回复

商务合作
商务合作