POINTERWHEEL does not work On targetCamera

I created a PG to describe the problem I am having

Something is wrong with your switch logic.
Here is the working example with simple if conditions - https://playground.babylonjs.com/#KBRZTB#2

2 Likes

Not sure what you’re trying to achieve by passing 999 for the mask? But if you want the function to be called for just pointer down and pointer wheel events then the mask should be POINTERDOWN OR’ed with POINTERWHEEL, like below. Or you could omit the mask param altogether like Labris did and that’ll work too since you’re already checking the type manually anyway. :slight_smile:

thank you for your reply

Maybe my previous understanding of the api was wrong
I want to remove the last specified listener before adding the listener
Maybe you can help me see if my code is wrong
thanks a lot

The function add returns the Observer which can be stored and later passed to remove (you can also call clear to remove all of the observers). The mask parameter limits which event(s) you’re observing.

4 Likes