This is my PG:
When I press and drag the sphere, it moves freely on the screen. When I click on the sphere and scroll the mouse wheel, I want to change the depth of the sphere on the screen. But it doesn’t seem to be working.
I printed the calculated world position, but it looks like the position has been set back.
Does anyone know why that is, thank you?
Hello !
I would say it’s because you have a conflict between your drag behavior and your wheel custom event. When the mouse is down, the drag behavior is active, so whatever position you force on the sphere, is will be anyway overrided by the drag behavior
If you really want to keep these controls (same click down for both drag and wheel stuff) I think you will need to code a custom drag event yourself (on mouse move, scene.pick, etc)
2 Likes
The meaning is: do not use ‘dragBehavior’, using ‘scene.OnPointerObservable’ or other, to implement drag mesh, wheel to realize the function I need?
Almost, but not taking with the movement of the ground point to deal with, is free to move under the current camera view in the scene,
It looks like that’s what I need
1 Like