Event.wheel not working

I’m trying to code a zoom mechanic for my orbit camera script and the event.wheel is not working

CameraFunctions.prototype._onMouseRoll = function (e) {
    this.entity.translateLocal(0,0,event.wheel * 10);
};

also here’s the link to the project: PlayCanvas | HTML5 Game Engine

Hi @MavrosMax and welcome,

In our CameraFunctions.js script I don’t see that code but this, which as expected doesn’t work:

CameraFunctions.prototype._onMouseRoll = function (e) {
    this.entity.translateLocal(0,0,1);
};

Try implementing the code you’ve added in place.

1 Like

oh yeah its because since it isn’t working so switched it to make sure the scroll event itself was working. Its still not working