I have 2 images: SourceImage and TargetImage. I want the width of TargetImage to match the width of SourceImage. This is the RectTransform of the source image: I tried this but it sets the width to 0 I also tried this but the size is wrong: How can I get the width of TargetImage to match the width of SourceImage?
Did you mean to get the RectTransform size or the Image size? If the latter, you should be getting the Image component. It looks like your rect is size 0?
Yes. It is zero. I want to get the current size of the SourceImage related to the current screen resolution. The SourceImage changes size because of the screen size.