Hello guys, I can't find a solution for a problem I'm having - I'm using the script "UIScrollToSelection.cs" and it works like a charm - incredible work! But I'm having an issue, I have the hierarchy organized in this way:
The selectable buttons are the ITEMS, and they're children of some empty GameObject (like Weapons, Foods etc.), in this way the ScrollView doesn't scroll with the selected item - but if I take all ITEMS outside to make them children of Content - the scroll works perfectly. But for how I've organized the project that's not possible for me unless I redo a big portion of it and I would like to avoid.
In the code I think the "problem" is at line 149
if (selection == null || selection.transform.parent != LayoutListGroup.transform)
selection.transform.parent will be Foods or Weapons - so this return will be called - but if I just delete that condition it still doesn't work - can someone help me with this please? I've been stuck the whole day on this issue.
No worries, happy to help and glad you got it resolved. The package is available on
I recommend the UPM version as it also gives you version control in Unity and tells you when there are updates (as well as not messing up your asset folder)