- Home /
Updating position of Parent Gameobject causes ScrollBar.onValueChanged to fire
Consider a gameobject hierarchy as the following:
ContainerGo
ScrollRect
ScrollBar(Vertical)
ViewPort
Content
Translating or rotating the ContainerGO causes the onValueChanged
event to fire on the ScrollBar
component.
While attempting to debug, I looked at Unity's ScrollRect
implementation and it seems like it fires off this event when previous bounds for the ViewPort or the Content have changed or the anchoredPosition
of the Content Go but i'm confused as to why that would happen if I'm updating the transform of the parent GO and not any of it's children.
I want to be able to move the ContainerGo without firing off the onValueChanged
for the ScrollBar
?
Answer by cgilbers-ts · Dec 15, 2021 at 08:22 AM
If anyone else stumbles upon this question, this is a bug in Unity: https://issuetracker.unity3d.com/issues/scroll-rect-on-value-changed-is-triggered-when-parent-position-changes-after-scrolling
Your answer
Follow this Question
Related Questions
How to drag my armory from GUI to Terrain? 1 Answer
How to posistion GUI elements? 1 Answer
Camera being disabled by any GUI button 2 Answers
GUI Over AI characters 1 Answer