From 4aa25b0f6cb5d8d22820d36164b17359a9417027 Mon Sep 17 00:00:00 2001 From: PouleyKetchoupp Date: Mon, 22 Mar 2021 15:41:21 -0700 Subject: [PATCH] More detailed documentation for KinematicBody safe collision margin --- doc/classes/KinematicBody2D.xml | 5 ++++- doc/classes/KinematicBody3D.xml | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/doc/classes/KinematicBody2D.xml b/doc/classes/KinematicBody2D.xml index 476b64a336f..fdd4db61157 100644 --- a/doc/classes/KinematicBody2D.xml +++ b/doc/classes/KinematicBody2D.xml @@ -162,7 +162,10 @@ - If the body is at least this close to another body, this body will consider them to be colliding. + Extra margin used for collision recovery in motion functions (see [method move_and_collide], [method move_and_slide], [method move_and_slide_with_snap]). + 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. If [code]true[/code], the body's movement will be synchronized to the physics frame. This is useful when animating movement via [AnimationPlayer], for example on moving platforms. Do [b]not[/b] use together with [method move_and_slide] or [method move_and_collide] functions. diff --git a/doc/classes/KinematicBody3D.xml b/doc/classes/KinematicBody3D.xml index a21496de540..efd3f58f883 100644 --- a/doc/classes/KinematicBody3D.xml +++ b/doc/classes/KinematicBody3D.xml @@ -177,7 +177,10 @@ Lock the body's Z axis movement. - If the body is at least this close to another body, this body will consider them to be colliding. + Extra margin used for collision recovery in motion functions (see [method move_and_collide], [method move_and_slide], [method move_and_slide_with_snap]). + 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.