-1

我正在尝试在 Cocos creator 3.4 中开发螺旋跳跃,但我不知道如何使其平滑当我尝试使用 setWorldRotationFromEuler 时,它会移动塔,但当我单击相同位置时,它会移回初始触摸位置。

  input.on(Input.EventType.TOUCH_MOVE
         , function(touch){    
  this.node.setWorldRotationFromEuler(0 ,touch.getLocationX()/2 ,0)           
    },this)
4

1 回答 1

0
    input.on(Input.EventType.TOUCH_MOVE
        , function(touch){
   var qout1=Quat.toEuler(new Quat,this.tower.getRotation())
     this.node.setWorldRotationFromEuler(0,(qout1.y+touch.getDeltaX()/3),0)
   },this)
}

这将解决问题

于 2021-12-30T15:50:22.917 回答