Hi, I am confused why I am getting this error:
Uncaught TypeError: this.entity.setLocalEulerAngles is not a function
I have used a setTimeout function while rotating a ‘bird’ entity, because I want to make it stay upright longer. Here is what I have done:
var zrot = pc.math.clamp(this.velocity, -2, -0.75);
zrot += 1;
this.entity.setLocalEulerAngles(0, 0, zrot + 22.5);
setTimeout(function () {
this.entity = zrot;
this.entity.setLocalEulerAngles(0, 0, zrot * 90);
}, 750);
The bottom part of the code is where the error is occurring. However, I cannot solve the problem, because I don’t know what I can do to fix this. Any help?
Game: