setSiblingIndex 后, node.on(NodeEventType.TOUCH_START... 会失效

cocos cretor 3.8.5
setSiblingIndex 后, node.on(NodeEventType.TOUCH_START… 会失效, 这是咋回事?

用demo试了下单独点击没问题, 应该是特殊情况导致的,我查查啥原因

临时解决方案:在call中调用this.lastSel.scale = Vec3.ONE

测试发现是tween的问题,以下代码会导致lastSel的touch失效。

this.lastSel.setSiblingIndex(-1);
tween(this.lastSel).parallel(
    tween(nowNode).to(1, { position: this.lastSel.position }),
    tween(this.lastSel).to(1, { position: nowNode.position }),
    tween(this.lastSel).to(0.5, { scale: new Vec3(1.2,1.2) }).to(0.5, { scale: new Vec3(1,1) }),
).call(()=>{
    Debug.Warn("还源")
    this.lastSel = null;
}).start();

把这句删掉就正常, 是我tween用的不对?动画表现是正常的,也没报错。

tween(this.lastSel).to(0.5, { scale: new Vec3(1.2,1.2) }).to(0.5, { scale: new Vec3(1,1) }),

设置缩放的时候把Z设置成1

把scale的new Vec3(1,1,1)的三个参数都填上

1赞

好吧, 我以为留空会保留原值