In an angry birds game I have this code for lining up the bird to fling:
Angry Birds: Snap to circle
Code (CSharp):
- if (Input.GetButton("Fire1") && !F)
- {
- mv = Camera.main.ScreenToWorldPoint(Input.mousePosition);
- transform.position = Vector2.Lerp(transform.position,mv,1);
- transform.right = transform.position - transform.localPosition;
- if(transform.localPosition.x > 1)
- {