The script changes the gun sprite. When the script applies “assault-rifle” stripes, which are nearly the same size physically, there’s no problem, but when the script applies the handgun sprite, it is stretched, even though the image has “preserve aspect” as selected.
In the end of the video you can see that when I manually select the sprite (by selecting some other stripe and then selecting the main one again), the stripe is scaled correctly.
Note: If I try to change the other options of the “Image” inspector, like “color”, they don’t even work, until I reselect the stripe manually.
I am unable to understand what am I missing here.
Please help.
Thank you.
How I am applying the sprite:
public Image PrimaryWeaponIcon;
PrimaryWeaponIcon.sprite = newSprite;