- Home /
How to implement scaling without scaling the texture.
Good day! So the question is how to implement the next behavior: I have game object in 2D project that scales over time to one side (actually scales in both sides but also moves towards the scale direction) you can see it on gif below.
If i attach texture (sprite?) it will scale with object as well - this is not what i'm attempting to do. One solution is to set Clamp or Repeat parameter in the texture inspector. But it's also not acceptable for me. I don't know how exactly to explain what i want to do... but lets imagine that i have the final texture invisible and during the scaling of object new parts of that texture becomes visible. You can see that behavior on next gif.
I guess i need some kind of shader that implements it so please provide me with that script ( i'm totally new to shaders coding, only know the basics). Take on account that I'm going to animate the texture that will be attached to scaling object, maybe it also will affect the shader script. Cheers.
I not sure if I understood you correctly but u can take a look at 2D sprite masks https://docs.unity3d.com/$$anonymous$$anual/class-Sprite$$anonymous$$ask.html You can have your final sprite and only show parts of it by scaling a 2D mask
Your answer
Follow this Question
Related Questions
Multiple Vectors in shader/CGINC 0 Answers
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Can I see the calculation of unity_MatrixVP ? 1 Answer
What is best way to add transparent padding all around my sprites? 2 Answers