Hello everyone,
Searching for hours now. I basically want to scale a sprite ( Unity 4.3 ) by setting a world pos.
I’m searching for proportinal values but can’t obtain something satisfying.
So basically I want something like gameObject.transform.localScale.x = 228 * ratio
Thanks in advance for any maths help
Edit:
Further explanations:
I have a simple Cube created in hierarchy which has a scale x and y of 45.
I have a sprite created from a texture ( 128 x 64 ) that I want to be exactly as big as the cube ( so 45 x 45 in world pos )
How can I, in code, calculate the ratio between the 100 x 100 values of the sprite scale in the inspector to the 45 x 45 worldspace pos that I want?
My sprites are in 100 pixelsToUnits.
My camera ortho size is half my screen height, so 500 actually.