Skip to content

Fix can_move_to and rename it for more clarity

Rafał Mikrut requested to merge github/fork/akien-mga/pr-fix-can-move-to into master

Created by: akien-mga

Fixes #2416 (closed). The KinematicBody::can_move_to function was likely designed for two behaviours:

  • discrete: check if the body can "teleport" to the destination
  • continuous: check if the direct path to the destination is valid

The continuous behaviour was however not implemented, and the discrete behaviour was broken too due to a wrong call to intersect_shape.

The discrete behaviour has thus been fixed and the function renamed to can_teleport_to for more clarity.

Merge request reports