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

Collision with draggable object

Discussion in '2D' started by Zetroy, Mar 21, 2017.

  1. Zetroy

    Zetroy

    Joined:
    Mar 21, 2017
    Posts:
    5
    I've got two objects: circle(bouncy) and draggable object in 2D game. So the problem is, when bouncy circle is not moving and I'm trying to smash it with draggable object, the force applied looks like it is not strong enough, and circle is moving slow. The gravity is off, and draggable object is kinematic.
     
  2. JoshGreen

    JoshGreen

    Joined:
    Mar 16, 2017
    Posts:
    28
    Hi Zetroy, have you tried using a really strong spring to connect the draggable object to the touch point, instead of moving the object to the touch point. If you do I believe physics will apply correctly.
     
    Zetroy likes this.
  3. Zetroy

    Zetroy

    Joined:
    Mar 21, 2017
    Posts:
    5
    JoshGreen, That's good idea, but I've tried just now, and it seem like the speed is not fast enough
     
  4. JoshGreen

    JoshGreen

    Joined:
    Mar 16, 2017
    Posts:
    28
    Sorry Zetroy, whats not not fast enough? The touch point spring to the game object?
     
  5. Zetroy

    Zetroy

    Joined:
    Mar 21, 2017
    Posts:
    5
    JoshGreen, so the action I want look like this


    but second object suppose to go a little bit faster, because the mass of first will be higher than seconds. But instead of this, the first object just pushed the second, or the speed of second object is less than first object after collision.
     
  6. JoshGreen

    JoshGreen

    Joined:
    Mar 16, 2017
    Posts:
    28
    Hi Zetroy, are you using 2D springs, or 3D springs? 2D springs seem to do the job for me. However, you might want to write your own simple 2D spring then you can alittle more control over it.