Text alignment not working

I am creating a game where I instantiate a prefab with a text component into a child of a canvas, and then edit the text variable. When I do so, the text doesn’t appear where it should relative to its rectTransform and text alignment. Changing the alignment has no affect, although I can change the font and colour. I can also change the position with the rTrans position and pivot, as well as scale and rotation. This prefab works in other canvases that I have in the scene at the same time, but the troublesome canvas is the only one in Screen Space (Cam) render mode. If I add a prefab before i play it, it works properly. I use two different prefabs with different pivots, and text alignments only; both don’t work. I have already implemented the function over a year ago, and it has worked as intended. It is only recently, when i was working on what I am pretty sure is unrelated, that this problem started, and I don’t know what the cause is.


There are no other scripts attached to the texts other than what is on the image.
There is a parent that changes scale but I didn’t think it would cause the error as it has worked while using it.

I see position at x:25.86, y:76.1.
You probably want to reset this to 0, 0, as your using a fixed anchor, the position behaves as a delta between parent and child pivot points.

I figured it out. In the texts’ parent gameobject, I have a script that automatically changes scale to make sure that the puzzle stays on screen in the right position. Every Update frame it would calculate what scale it should be and then go: rectTransform.localScale = Vector3.one x scale; However, I was editing the script to take into account some side options and I ended making it rectTransform.localScale = ** Vector2.one x scale;**
(I think) this makes the z scale axis 0f, which caused the error.
and if it didn’t my game now works anyway.