Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var mousePosition = Camera.main.ScreenToWorldPoint (Input.mousePosition);
- Quaternion rot = Quaternion.LookRotation(transform.position - mousePosition,Vector3.forward);
- transform.rotation = rot;
- transform.eulerAngles = new Vector3 (0, 0, transform.eulerAngles.z);
- float input = Input.GetAxis ("Vertical");
- rigidbody2d.AddForce (gameObject.transform.up * speed * input);
- public float speed;
- public float time;
- public Rigidbody2D rigidbody2d;
- Animator anim;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement