I Dont know how to get the width and height of object in script.Unity 2D

i want to know if i can get width and height of my object that has only rect transform(Image). I just want to get my image height and width equal to my canvas so image size will always be equal to my camera.

1 Like

Just stretch the image as shown below using the Editor UI.

Please use the UGUI tag not the 2D tag. The 2D feature set isn’t related to UGUI.

I’ll change the tags for you.

Thanks.

1 Like