Setting a component’s “Use Attach Parent Bound” to true has fixed this issue for me in the past. This way you don’t need to change any code. Hope that helps!