Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void FixedUpdate()
- {
- myRigidbody.velocity = (new Vector2 (PlayerSpeed * Input.GetAxis("Horizontal"),PlayerSpeed * Input.GetAxis("Vertical")));
- }
- void OnCollisionEnter2D(Collision2D collision)
- {
- if (collision.transform.tag == "Border")
- {
- Debug.Log("Border");
- myRigidbody.velocity = Vector2.zero;
- myRigidbody.angularVelocity = 0f;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement