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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Dragging Physics Rigidbody with High sensativity

Discussion in '2D' started by coder_for_life22, Aug 28, 2018.

  1. coder_for_life22

    coder_for_life22

    Joined:
    Dec 25, 2013
    Posts:
    46
    I am trying to drag a physics body with high sensativity.

    Right now I am using Move position function of the Rigidbody and adding a multiplier to make the sebsisensit higher.

    The issue is that I am using two box colliders on the left & right of the screen but when making swift movements, it goes through collider of screen.

    I read that this normal behavior with dragging Rigidbodies fast.

    Is it possible to keep the dragged object on screen and avoid it going out of vounds(off screen) when dragging fast?
     
  2. LiterallyJeff

    LiterallyJeff

    Joined:
    Jan 21, 2015
    Posts:
    2,802
    See "collision detection" property: https://docs.unity3d.com/Manual/class-Rigidbody.html
    Use "continuous" mode. It's more expensive but prevents tunneling.
     
    coder_for_life22 likes this.
  3. coder_for_life22

    coder_for_life22

    Joined:
    Dec 25, 2013
    Posts:
    46