- Home /
ScrollRect makes object behind it move
Hello!
I have a canvas with my 3D model (lungs) on it- can interact with these using the mouse to click and drag (rotate), scroll wheel (zoom in/out) and click scroll (pan) or using touch inputs on mobile. I have buttons on the canvas that let you open up a 'more info' panel- this has the ScrollRect on it to allow you to scroll through the more information text. HOWEVER when I scroll through the text, the model behind it is also moving. Is there a way that I can disable the model (don't want it to disappear, just stop being interactable) when the panels are open, then 're-enable' it again when I exit off the panel? This picture is before I open up the more info panel...
And this one after- then when I try and scroll down through the text the lungs behind it are still moving around/zooming in and out if I scroll.
Answer by Bystander333 · Jul 13, 2018 at 03:07 PM
Use EventSystem.current.IsPointerOverGameObject() in the lungs input code.
If true then the pointer is over a UI element.