I’m doing something similar to a slider control, but instead of using the UI slider, I’m rezzing gameobjects and destroying game objects depending on which way you’re dragging your mouse.
In other words, take a prefab cube that’s longer than it is wide, and add clones of it on screen as you drag your mouse right. Remove the clones, 1 at a time, as you drag the mouse left.
This is in 3D though, so as soon as the orbit camera flips to the other side of orbit, left & right are now backwards from what makes sense.
I need to get away from left & right and establish a new rule - if the mouse is dragging towards the center of the world (Vector3.zero) then you’re removing clones. Conversely, if you’re dragging away from center then you’re adding clones.
My issue is properly detecting dragging towards world center and away from it in an OnMouseDrag() event.
Preferrably I’d like to get back a single float value which is Distance from mouse location to world center.
Can someone enlighten me?
Cheers and thanks in advance!