Advertisement
Guest User

Untitled

a guest
May 26th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. void OnCollisionEnter2D(Collision2D collision)
  2. {
  3. Vector3 tweak = new Vector3(Random.Range(0f, 0.2f), Random.Range(0f, 0.2f), 0f);
  4.  
  5. if (hasStarted)
  6. {
  7. GetComponent<AudioSource>().Play();
  8. rigidbody.velocity += tweak;
  9. }
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement