Scale Sprite like UI Canvas
Hello all, i have a question
i wanna learn how i can do a scale sprite like in UI Canvas
i know if i use rect transform in UI Canvas they can scale to any resolution
if i try to use "rect transform" in a normal sprite out the canvas they not work, ¿ i am doing something wrong ?
¿ how i can do that with a normals sprites and anothers objects into the game when they are no UI canvas ?
Help Please i really wanna make my game for any resolution and i think this is the tip most important :(
Answer by Awesome123321 · Apr 20, 2019 at 09:42 PM
Hi,
Normally you would use an animation and modify scale within the animation. If you want to scale the sprite or other object, a good idea is to nest it in an empty object as a good practice for position, then you can use:
https://docs.unity3d.com/ScriptReference/Transform-localPosition.html
If you are adding sprites for UI then create a UI object by right mouse click in Hierarchy window create UI > Image or UI > raw sprite depending on application and then assign image in the inspector from your assets. .PNG or Photoshop files are normally the best formats to use.
Kind regards,
J