UI elements moving for seemingly no reason

I made this hacking UI for a mechanic in my game and one of the features is that panel labeled ‘stabilize’.
This panel moves around SOMETIMES in-game and I cannot figure out why. I have been keeping it in place with an animation but I ran into a roadblock which eliminated the option to keep using that workaround. The image below is how it is supposed to appear.

The image below is how it is when it moves in-game.

I have no idea why it’s doing this. I have checked that it is anchored correctly, and as I said I tried animating it to stay in place. Any suggestions are greatly appreciated (also sorry if this is in the wrong thread, I tried to get as close as possible)!!

That’s not an explanation to your problem but a workaround would be to add a geometry changed event to the panel and fix its position when necessary. However you need to track in the debugger (in Show All mode) what exactly changed, my guess would be one of the align options or justify-content. The parent might be the reason of the issue. Maybe one of the classes has been removed or added?

I found it that it only moves because it has a rigidbody attached to it which it need for the mechanic to work. I froze the x position but it is still moving. I think I am getting close to figuring it out. Thank you for your response!

I still have no idea why it is moving. I know it has something to do with the rigidbody connected to it. The mechanic relies on the rigidbody though so I cannot take it off. I Tried messing around with some settings but the only way that seems to be working is by animating it to return it to its x position. I did figure out a way that animating it works without conflicting with the mechanic, so I will keep using that workaround unless I find the root of the problem or discover a more efficient way to solve it.

It seems you are using UGUI since you’re talking about a Rigidbody, which belongs to the GameObject world. Do you mind if I move the thread to the UGUI forum? Unity Engine - Unity Discussions