Advertisement
Guest User

Untitled

a guest
May 25th, 2015
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.44 KB | None | 0 0
  1.     void FixedUpdate()
  2.     {
  3.             myRigidbody.velocity = (new Vector2 (PlayerSpeed * Input.GetAxis("Horizontal"),PlayerSpeed * Input.GetAxis("Vertical")));
  4.     }
  5.  
  6. void OnCollisionEnter2D(Collision2D collision)
  7.     {
  8.        
  9.         if (collision.transform.tag == "Border")
  10.         {
  11.             Debug.Log("Border");
  12.             myRigidbody.velocity = Vector2.zero;
  13.             myRigidbody.angularVelocity = 0f;
  14.         }
  15.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement