- Home /
Pull and Push spring on finger moving.
Hi, I am working on 2D game in Unity 4.3. I have spring sprite Image. I want to stick its origin at one position and just increase and decrease its height and I don't need to get worry about its pixelated problem but I just to look like real as we Pull and Push some spring. What approach should I follow, Either do this by changing its scale and rotation but it require too much calculation or there are some good and easy approach for this? I attached my Image, kindly view this and suggest me some better approach to perform this task. Thanks.
Answer by poncho · Jan 16, 2014 at 02:51 PM
you could use some anchorage points, each spring to white line point as the startpointspring1, startpointspring2, the red point as the endpointforsprings, then get the degree of the 2 points and change the rotation of the springs, for the scale, magnitude diference between those points, could give you the local scale, for the force it will generate, a cuadratic i think it is the best for a spring behavior. some little math, but a real easy coding, good luck and happy coding