Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Prevent Rigdibody2D from natural collision

Discussion in '2D' started by BMYU, Jun 17, 2014.

  1. BMYU

    BMYU

    Joined:
    Jun 17, 2014
    Posts:
    11
    I want to prevent rigidbody2d from natural collision response while collider attached to rigidbody and physics system(eg : Rigidbody2D.AddForce) works.

    I tried Rigidbody2D.simulated = false but it makes physics system stop, either collider.
     
  2. cbothra

    cbothra

    Joined:
    Mar 14, 2014
    Posts:
    125
  3. Pyrian

    Pyrian

    Joined:
    Mar 27, 2014
    Posts:
    301
    isKinematic shuts down AddForce. Why not just disable the collider?
     
  4. cbothra

    cbothra

    Joined:
    Mar 14, 2014
    Posts:
    125
    Collider can be disabled but than what in that case if someone require to know if its hit by another object even it wont respond to the physics.
     
  5. Pyrian

    Pyrian

    Joined:
    Mar 27, 2014
    Posts:
    301
    If he wants AddForce but not collisions, the appropriate step is to disable the collider. If he wants to detect the collisions without actually physically colliding and bouncing off, the appropriate step is to set the collider to Trigger (and make sure to catch Trigger events).
     
    BMYU likes this.
  6. cbothra

    cbothra

    Joined:
    Mar 14, 2014
    Posts:
    125
    You are right!! however it depends on the context in which he want to use :)
     
  7. BMYU

    BMYU

    Joined:
    Jun 17, 2014
    Posts:
    11
    That is exactly what I want. Thanks!!