KinematicBody2D.collisionSafeMargin

Extra margin used for collision recovery in motion functions (see moveAndCollide, moveAndSlide, moveAndSlideWithSnap). If the body is at least this close to another body, it will consider them to be colliding and will be pushed away before performing the actual motion. A higher value means it's more flexible for detecting collision, which helps with consistently detecting walls and floors. A lower value forces the collision algorithm to use more exact detection, so it can be used in cases that specifically require precision, e.g at very low scale to avoid visible jittering, or for stability with a stack of kinematic bodies.

  1. double collisionSafeMargin [@property getter]
    struct KinematicBody2D
    @nogc nothrow @property
    double
    collisionSafeMargin
    ()
  2. double collisionSafeMargin [@property setter]

Meta