Advertisement
Guest User

Untitled

a guest
Aug 20th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. private void OnCollisionEnter2D(Collision2D collision)
  2. {
  3. fallVector = GetRigidbody.velocity.normalized;
  4. fallNormalVector = collision.contacts[0].normal;
  5.  
  6. var reflectedVelocity = Vector3.Reflect(fallVector, fallNormalVector).normalized;
  7. GetRigidbody.velocity = reflectedVelocity * 3;
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement