Search Unity

Question How not to skip the collider without rigidbody and character controller.

Discussion in 'Physics' started by Zimaell, Apr 16, 2023.

  1. Zimaell

    Zimaell

    Joined:
    May 7, 2020
    Posts:
    409
    I make the movement of the object through a transform or through a movetowards, with capsule collider, I check the ground through a check sphere, but when the object goes down or up on an inclined, it sometimes falls through the ground (through a collider, for example, a terrain).

    How to exclude the penetration of one collider into another, to exclude such failures in the ground or in the walls? Important: without rigidbody and character controller (for some reasons)

    Game in 3D, fixedupdate (for network).
     
  2. Turtlehellmax

    Turtlehellmax

    Joined:
    Nov 26, 2020
    Posts:
    5
    This is bound to happen if you modify the transform's position directly. I would recommend adding a rigidbody to the character locally and using Rigidbody.MovePosition instead.