if (this.app.keyboard.isPressed(pc.MOUSEBUTTON_LEFT)) {
this.sword.rotate(X = 90, Z = 0);
}
Ok so this is my method of making the sword rotate 90 degrees after mousebutton click but doesnt work anyone know why?
if (this.app.keyboard.isPressed(pc.MOUSEBUTTON_LEFT)) {
this.sword.rotate(X = 90, Z = 0);
}
Ok so this is my method of making the sword rotate 90 degrees after mousebutton click but doesnt work anyone know why?
I think you want something like:
…
this.sword.rotate(90,0,0);
https://developer.playcanvas.com/en/api/pc.Entity.html#rotate
Also, you may want to set local rotation and not global.
Oh ok i will check it out thank you!