Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Detecting collider slip

Discussion in '2D' started by jimmio92, Mar 3, 2014.

  1. jimmio92

    jimmio92

    Joined:
    Nov 3, 2009
    Posts:
    31
    Hello all,

    I'm trying to detect when a ball that I control is slipping. I add torque to it to get it moving, and it's got enough power to slip. I was hoping to play some sound when it slips to further engage the player. Any ideas?

    Code (csharp):
    1.  
    2. if(isGrounded) {
    3.     if(rigidbody2D.angularVelocity/circumference > rigidbody2D.velocity.magnitude) { //This doesn't work
    4.         //TODO: Play sound
    5.     }
    6. }
    7.