Horizontal scroll view with horizontal layout group doesn't scroll
I've tried to add a scroll view
to my app and I'm unable to get it to scroll.
Since I've considered that it may be because of the complicated nesting in my content
, I've tried to add a simple scroll view
and added a horizontal
or vertical layout group
to the content
with some static images and I'm still unable to get any response by clicking and dragging, or clicking on the scroll bar.
I've also tried expanding the size of the content
to go beyond the view area, and I've also made sure that I have an EventSystem
.
I'm sure I'm missing something simple, but researching examples and tutorials I'm not quite catching it.
One thing that may be causing issues, I have two Canvases that start out as Screen Space - Camera
, and then one of them changes to World Space
at run time. The canvas I'm having trouble in is the one that stays as Screen Space - Camera
.
I've been trying to add some screenshots of my configurations, but whether it's jpg or png unity gives me an error saying it can't parse the file in both chrome and edge... I'm sure that would help if I could get those in there. Any tips on that front would be appreciated.
Answer by bfreester · Jul 01, 2020 at 09:02 PM
I was able to fix this by recreating the structure elements down to the root canvas. After doing that the scroll would respond to mouse clicks and drags.
I recreated everything with the exact same settings so I'm not sure what happened, but something must have gotten corrupted somewhere.
My biggest suspicion is I had one element that had a canvas component that was overriding sorting layers. I was able to get some different behavior by playing around with that component, but I couldn't completely fix the issue until I built the entire tree from scratch, keeping the same settings I had before.