Problem can not be solved by the moment due to Unity bug.
Matching RectTransform positions from different canvases
I'm having an issue where I can no longer use this line:
RectTransform1.position = RectTransform2.position;
When I use that line, the RectTransform does not actually move on the screen. It stays in the same spot.
I tested with setting RectTransform.anchoredPosition, and that does move it, but I'm not sure how to convert RectTransform1.anchoredPosition to be at RectTransform2.position. These RectTransforms will be in two separate Overlay canvases.
Any ideas?
(The purpose of this code is to move a selection cursor to specific points in the UI that are currently selected.)
Answer by Disastercake · Apr 23, 2018 at 04:56 PM
After a couple days of testing and trying to repro the bug, I finally discovered that the "Aspect Ratio Fitter" component is currently bugged out and preventing RectTransform being moved by anything other than its anchoredPosition.
Aspect Ratio Fitter https://docs.unity3d.com/Manual/script-AspectRatioFitter.html
Removing it from the Canvas object works perfectly, but it's required that my game have a specific aspect ratio... I guess I'll just report it and pray to the Unity gods that it gets fixed before I have to release.
Follow this Question
Related Questions
How to create a back button? 0 Answers
Changing Music On Icon To Off and saving the preference 2 Answers
Level Selector - Level Images for Brick Breaker 2 Answers
Unity 5.5 to Unity 2017 - Google VR 0 Answers