Skip to content

Commit cda419a

Browse files
committed
Merge pull request #112180 from Calinou/doc-characterbody-get-last-slide-collision
Document `CharacterBody.get_last_slide_collision()` returning `null` with no collision
2 parents 9b36dfe + eccd82a commit cda419a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

doc/classes/CharacterBody2D.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
<method name="get_last_slide_collision">
4646
<return type="KinematicCollision2D" />
4747
<description>
48-
Returns a [KinematicCollision2D], which contains information about the latest collision that occurred during the last call to [method move_and_slide].
48+
Returns a [KinematicCollision2D] if a collision occurred. The returned value contains information about the latest collision that occurred during the last call to [method move_and_slide]. Returns [code]null[/code] if no collision occurred. See also [method get_slide_collision].
4949
</description>
5050
</method>
5151
<method name="get_platform_velocity" qualifiers="const">
@@ -70,7 +70,7 @@
7070
<return type="KinematicCollision2D" />
7171
<param index="0" name="slide_idx" type="int" />
7272
<description>
73-
Returns a [KinematicCollision2D], which contains information about a collision that occurred during the last call to [method move_and_slide]. Since the body can collide several times in a single call to [method move_and_slide], you must specify the index of the collision in the range 0 to ([method get_slide_collision_count] - 1).
73+
Returns a [KinematicCollision2D], which contains information about a collision that occurred during the last call to [method move_and_slide]. Since the body can collide several times in a single call to [method move_and_slide], you must specify the index of the collision in the range 0 to ([method get_slide_collision_count] - 1). See also [method get_last_slide_collision].
7474
[b]Example:[/b] Iterate through the collisions with a [code]for[/code] loop:
7575
[codeblocks]
7676
[gdscript]

doc/classes/CharacterBody3D.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<method name="get_last_slide_collision">
4747
<return type="KinematicCollision3D" />
4848
<description>
49-
Returns a [KinematicCollision3D], which contains information about the latest collision that occurred during the last call to [method move_and_slide].
49+
Returns a [KinematicCollision3D] if a collision occurred. The returned value contains information about the latest collision that occurred during the last call to [method move_and_slide]. Returns [code]null[/code] if no collision occurred. See also [method get_slide_collision].
5050
</description>
5151
</method>
5252
<method name="get_platform_angular_velocity" qualifiers="const">
@@ -77,7 +77,7 @@
7777
<return type="KinematicCollision3D" />
7878
<param index="0" name="slide_idx" type="int" />
7979
<description>
80-
Returns a [KinematicCollision3D], which contains information about a collision that occurred during the last call to [method move_and_slide]. Since the body can collide several times in a single call to [method move_and_slide], you must specify the index of the collision in the range 0 to ([method get_slide_collision_count] - 1).
80+
Returns a [KinematicCollision3D], which contains information about a collision that occurred during the last call to [method move_and_slide]. Since the body can collide several times in a single call to [method move_and_slide], you must specify the index of the collision in the range 0 to ([method get_slide_collision_count] - 1). See also [method get_last_slide_collision].
8181
</description>
8282
</method>
8383
<method name="get_slide_collision_count" qualifiers="const">

0 commit comments

Comments
 (0)