class_kinematicbody.rst 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the KinematicBody.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_KinematicBody:
  6. KinematicBody
  7. =============
  8. **Inherits:** :ref:`PhysicsBody<class_PhysicsBody>` **<** :ref:`CollisionObject<class_CollisionObject>` **<** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. Kinematic body 3D node.
  10. Description
  11. -----------
  12. Kinematic bodies are special types of bodies that are meant to be user-controlled. They are not affected by physics at all; to other types of bodies, such as a character or a rigid body, these are the same as a static body. However, they have two main uses:
  13. **Simulated motion:** When these bodies are moved manually, either from code or from an :ref:`AnimationPlayer<class_AnimationPlayer>` (with :ref:`AnimationPlayer.playback_process_mode<class_AnimationPlayer_property_playback_process_mode>` set to "physics"), the physics will automatically compute an estimate of their linear and angular velocity. This makes them very useful for moving platforms or other AnimationPlayer-controlled objects (like a door, a bridge that opens, etc).
  14. **Kinematic characters:** KinematicBody also has an API for moving objects (the :ref:`move_and_collide<class_KinematicBody_method_move_and_collide>` and :ref:`move_and_slide<class_KinematicBody_method_move_and_slide>` methods) while performing collision tests. This makes them really useful to implement characters that collide against a world, but don't require advanced physics.
  15. Tutorials
  16. ---------
  17. - :doc:`../tutorials/physics/kinematic_character_2d`
  18. - `3D Kinematic Character Demo <https://godotengine.org/asset-library/asset/126>`__
  19. - `3D Platformer Demo <https://godotengine.org/asset-library/asset/125>`__
  20. - `3D Voxel Demo <https://godotengine.org/asset-library/asset/676>`__
  21. - `Third Person Shooter Demo <https://godotengine.org/asset-library/asset/678>`__
  22. Properties
  23. ----------
  24. +---------------------------+------------------------------------------------------------------------------------+-----------+
  25. | :ref:`bool<class_bool>` | :ref:`axis_lock_motion_x<class_KinematicBody_property_axis_lock_motion_x>` | ``false`` |
  26. +---------------------------+------------------------------------------------------------------------------------+-----------+
  27. | :ref:`bool<class_bool>` | :ref:`axis_lock_motion_y<class_KinematicBody_property_axis_lock_motion_y>` | ``false`` |
  28. +---------------------------+------------------------------------------------------------------------------------+-----------+
  29. | :ref:`bool<class_bool>` | :ref:`axis_lock_motion_z<class_KinematicBody_property_axis_lock_motion_z>` | ``false`` |
  30. +---------------------------+------------------------------------------------------------------------------------+-----------+
  31. | :ref:`float<class_float>` | :ref:`collision/safe_margin<class_KinematicBody_property_collision/safe_margin>` | ``0.001`` |
  32. +---------------------------+------------------------------------------------------------------------------------+-----------+
  33. | :ref:`bool<class_bool>` | :ref:`motion/sync_to_physics<class_KinematicBody_property_motion/sync_to_physics>` | ``false`` |
  34. +---------------------------+------------------------------------------------------------------------------------+-----------+
  35. | :ref:`bool<class_bool>` | :ref:`move_lock_x<class_KinematicBody_property_move_lock_x>` | ``false`` |
  36. +---------------------------+------------------------------------------------------------------------------------+-----------+
  37. | :ref:`bool<class_bool>` | :ref:`move_lock_y<class_KinematicBody_property_move_lock_y>` | ``false`` |
  38. +---------------------------+------------------------------------------------------------------------------------+-----------+
  39. | :ref:`bool<class_bool>` | :ref:`move_lock_z<class_KinematicBody_property_move_lock_z>` | ``false`` |
  40. +---------------------------+------------------------------------------------------------------------------------+-----------+
  41. Methods
  42. -------
  43. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. | :ref:`bool<class_bool>` | :ref:`get_axis_lock<class_KinematicBody_method_get_axis_lock>` **(** :ref:`BodyAxis<enum_PhysicsServer_BodyAxis>` axis **)** |const| |
  45. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | :ref:`float<class_float>` | :ref:`get_floor_angle<class_KinematicBody_method_get_floor_angle>` **(** :ref:`Vector3<class_Vector3>` up_direction=Vector3( 0, 1, 0 ) **)** |const| |
  47. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | :ref:`Vector3<class_Vector3>` | :ref:`get_floor_normal<class_KinematicBody_method_get_floor_normal>` **(** **)** |const| |
  49. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | :ref:`Vector3<class_Vector3>` | :ref:`get_floor_velocity<class_KinematicBody_method_get_floor_velocity>` **(** **)** |const| |
  51. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | :ref:`KinematicCollision<class_KinematicCollision>` | :ref:`get_last_slide_collision<class_KinematicBody_method_get_last_slide_collision>` **(** **)** |
  53. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  54. | :ref:`KinematicCollision<class_KinematicCollision>` | :ref:`get_slide_collision<class_KinematicBody_method_get_slide_collision>` **(** :ref:`int<class_int>` slide_idx **)** |
  55. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  56. | :ref:`int<class_int>` | :ref:`get_slide_count<class_KinematicBody_method_get_slide_count>` **(** **)** |const| |
  57. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | :ref:`bool<class_bool>` | :ref:`is_on_ceiling<class_KinematicBody_method_is_on_ceiling>` **(** **)** |const| |
  59. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | :ref:`bool<class_bool>` | :ref:`is_on_floor<class_KinematicBody_method_is_on_floor>` **(** **)** |const| |
  61. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | :ref:`bool<class_bool>` | :ref:`is_on_wall<class_KinematicBody_method_is_on_wall>` **(** **)** |const| |
  63. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | :ref:`KinematicCollision<class_KinematicCollision>` | :ref:`move_and_collide<class_KinematicBody_method_move_and_collide>` **(** :ref:`Vector3<class_Vector3>` rel_vec, :ref:`bool<class_bool>` infinite_inertia=true, :ref:`bool<class_bool>` exclude_raycast_shapes=true, :ref:`bool<class_bool>` test_only=false **)** |
  65. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | :ref:`Vector3<class_Vector3>` | :ref:`move_and_slide<class_KinematicBody_method_move_and_slide>` **(** :ref:`Vector3<class_Vector3>` linear_velocity, :ref:`Vector3<class_Vector3>` up_direction=Vector3( 0, 0, 0 ), :ref:`bool<class_bool>` stop_on_slope=false, :ref:`int<class_int>` max_slides=4, :ref:`float<class_float>` floor_max_angle=0.785398, :ref:`bool<class_bool>` infinite_inertia=true **)** |
  67. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | :ref:`Vector3<class_Vector3>` | :ref:`move_and_slide_with_snap<class_KinematicBody_method_move_and_slide_with_snap>` **(** :ref:`Vector3<class_Vector3>` linear_velocity, :ref:`Vector3<class_Vector3>` snap, :ref:`Vector3<class_Vector3>` up_direction=Vector3( 0, 0, 0 ), :ref:`bool<class_bool>` stop_on_slope=false, :ref:`int<class_int>` max_slides=4, :ref:`float<class_float>` floor_max_angle=0.785398, :ref:`bool<class_bool>` infinite_inertia=true **)** |
  69. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | void | :ref:`set_axis_lock<class_KinematicBody_method_set_axis_lock>` **(** :ref:`BodyAxis<enum_PhysicsServer_BodyAxis>` axis, :ref:`bool<class_bool>` lock **)** |
  71. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | :ref:`bool<class_bool>` | :ref:`test_move<class_KinematicBody_method_test_move>` **(** :ref:`Transform<class_Transform>` from, :ref:`Vector3<class_Vector3>` rel_vec, :ref:`bool<class_bool>` infinite_inertia=true **)** |
  73. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. Property Descriptions
  75. ---------------------
  76. .. _class_KinematicBody_property_axis_lock_motion_x:
  77. - :ref:`bool<class_bool>` **axis_lock_motion_x**
  78. +-----------+----------------------+
  79. | *Default* | ``false`` |
  80. +-----------+----------------------+
  81. | *Setter* | set_axis_lock(value) |
  82. +-----------+----------------------+
  83. | *Getter* | get_axis_lock() |
  84. +-----------+----------------------+
  85. Lock the body's X axis movement.
  86. ----
  87. .. _class_KinematicBody_property_axis_lock_motion_y:
  88. - :ref:`bool<class_bool>` **axis_lock_motion_y**
  89. +-----------+----------------------+
  90. | *Default* | ``false`` |
  91. +-----------+----------------------+
  92. | *Setter* | set_axis_lock(value) |
  93. +-----------+----------------------+
  94. | *Getter* | get_axis_lock() |
  95. +-----------+----------------------+
  96. Lock the body's Y axis movement.
  97. ----
  98. .. _class_KinematicBody_property_axis_lock_motion_z:
  99. - :ref:`bool<class_bool>` **axis_lock_motion_z**
  100. +-----------+----------------------+
  101. | *Default* | ``false`` |
  102. +-----------+----------------------+
  103. | *Setter* | set_axis_lock(value) |
  104. +-----------+----------------------+
  105. | *Getter* | get_axis_lock() |
  106. +-----------+----------------------+
  107. Lock the body's Z axis movement.
  108. ----
  109. .. _class_KinematicBody_property_collision/safe_margin:
  110. - :ref:`float<class_float>` **collision/safe_margin**
  111. +-----------+------------------------+
  112. | *Default* | ``0.001`` |
  113. +-----------+------------------------+
  114. | *Setter* | set_safe_margin(value) |
  115. +-----------+------------------------+
  116. | *Getter* | get_safe_margin() |
  117. +-----------+------------------------+
  118. Extra margin used for collision recovery in motion functions (see :ref:`move_and_collide<class_KinematicBody_method_move_and_collide>`, :ref:`move_and_slide<class_KinematicBody_method_move_and_slide>`, :ref:`move_and_slide_with_snap<class_KinematicBody_method_move_and_slide_with_snap>`).
  119. 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.
  120. A higher value means it's more flexible for detecting collision, which helps with consistently detecting walls and floors.
  121. 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.
  122. ----
  123. .. _class_KinematicBody_property_motion/sync_to_physics:
  124. - :ref:`bool<class_bool>` **motion/sync_to_physics**
  125. +-----------+------------------------------+
  126. | *Default* | ``false`` |
  127. +-----------+------------------------------+
  128. | *Setter* | set_sync_to_physics(value) |
  129. +-----------+------------------------------+
  130. | *Getter* | is_sync_to_physics_enabled() |
  131. +-----------+------------------------------+
  132. If ``true``, the body's movement will be synchronized to the physics frame. This is useful when animating movement via :ref:`AnimationPlayer<class_AnimationPlayer>`, for example on moving platforms. Do **not** use together with :ref:`move_and_slide<class_KinematicBody_method_move_and_slide>` or :ref:`move_and_collide<class_KinematicBody_method_move_and_collide>` functions.
  133. ----
  134. .. _class_KinematicBody_property_move_lock_x:
  135. - :ref:`bool<class_bool>` **move_lock_x**
  136. +-----------+----------------------+
  137. | *Default* | ``false`` |
  138. +-----------+----------------------+
  139. | *Setter* | set_axis_lock(value) |
  140. +-----------+----------------------+
  141. | *Getter* | get_axis_lock() |
  142. +-----------+----------------------+
  143. Lock the body's X axis movement. Deprecated alias for :ref:`axis_lock_motion_x<class_KinematicBody_property_axis_lock_motion_x>`.
  144. ----
  145. .. _class_KinematicBody_property_move_lock_y:
  146. - :ref:`bool<class_bool>` **move_lock_y**
  147. +-----------+----------------------+
  148. | *Default* | ``false`` |
  149. +-----------+----------------------+
  150. | *Setter* | set_axis_lock(value) |
  151. +-----------+----------------------+
  152. | *Getter* | get_axis_lock() |
  153. +-----------+----------------------+
  154. Lock the body's Y axis movement. Deprecated alias for :ref:`axis_lock_motion_y<class_KinematicBody_property_axis_lock_motion_y>`.
  155. ----
  156. .. _class_KinematicBody_property_move_lock_z:
  157. - :ref:`bool<class_bool>` **move_lock_z**
  158. +-----------+----------------------+
  159. | *Default* | ``false`` |
  160. +-----------+----------------------+
  161. | *Setter* | set_axis_lock(value) |
  162. +-----------+----------------------+
  163. | *Getter* | get_axis_lock() |
  164. +-----------+----------------------+
  165. Lock the body's Z axis movement. Deprecated alias for :ref:`axis_lock_motion_z<class_KinematicBody_property_axis_lock_motion_z>`.
  166. Method Descriptions
  167. -------------------
  168. .. _class_KinematicBody_method_get_axis_lock:
  169. - :ref:`bool<class_bool>` **get_axis_lock** **(** :ref:`BodyAxis<enum_PhysicsServer_BodyAxis>` axis **)** |const|
  170. Returns ``true`` if the specified ``axis`` is locked. See also :ref:`move_lock_x<class_KinematicBody_property_move_lock_x>`, :ref:`move_lock_y<class_KinematicBody_property_move_lock_y>` and :ref:`move_lock_z<class_KinematicBody_property_move_lock_z>`.
  171. ----
  172. .. _class_KinematicBody_method_get_floor_angle:
  173. - :ref:`float<class_float>` **get_floor_angle** **(** :ref:`Vector3<class_Vector3>` up_direction=Vector3( 0, 1, 0 ) **)** |const|
  174. Returns the floor's collision angle at the last collision point according to ``up_direction``, which is ``Vector3.UP`` by default. This value is always positive and only valid after calling :ref:`move_and_slide<class_KinematicBody_method_move_and_slide>` and when :ref:`is_on_floor<class_KinematicBody_method_is_on_floor>` returns ``true``.
  175. ----
  176. .. _class_KinematicBody_method_get_floor_normal:
  177. - :ref:`Vector3<class_Vector3>` **get_floor_normal** **(** **)** |const|
  178. Returns the surface normal of the floor at the last collision point. Only valid after calling :ref:`move_and_slide<class_KinematicBody_method_move_and_slide>` or :ref:`move_and_slide_with_snap<class_KinematicBody_method_move_and_slide_with_snap>` and when :ref:`is_on_floor<class_KinematicBody_method_is_on_floor>` returns ``true``.
  179. ----
  180. .. _class_KinematicBody_method_get_floor_velocity:
  181. - :ref:`Vector3<class_Vector3>` **get_floor_velocity** **(** **)** |const|
  182. Returns the linear velocity of the floor at the last collision point. Only valid after calling :ref:`move_and_slide<class_KinematicBody_method_move_and_slide>` or :ref:`move_and_slide_with_snap<class_KinematicBody_method_move_and_slide_with_snap>` and when :ref:`is_on_floor<class_KinematicBody_method_is_on_floor>` returns ``true``.
  183. ----
  184. .. _class_KinematicBody_method_get_last_slide_collision:
  185. - :ref:`KinematicCollision<class_KinematicCollision>` **get_last_slide_collision** **(** **)**
  186. Returns a :ref:`KinematicCollision<class_KinematicCollision>`, which contains information about the latest collision that occurred during the last call to :ref:`move_and_slide<class_KinematicBody_method_move_and_slide>`.
  187. ----
  188. .. _class_KinematicBody_method_get_slide_collision:
  189. - :ref:`KinematicCollision<class_KinematicCollision>` **get_slide_collision** **(** :ref:`int<class_int>` slide_idx **)**
  190. Returns a :ref:`KinematicCollision<class_KinematicCollision>`, which contains information about a collision that occurred during the last call to :ref:`move_and_slide<class_KinematicBody_method_move_and_slide>` or :ref:`move_and_slide_with_snap<class_KinematicBody_method_move_and_slide_with_snap>`. Since the body can collide several times in a single call to :ref:`move_and_slide<class_KinematicBody_method_move_and_slide>`, you must specify the index of the collision in the range 0 to (:ref:`get_slide_count<class_KinematicBody_method_get_slide_count>` - 1).
  191. ----
  192. .. _class_KinematicBody_method_get_slide_count:
  193. - :ref:`int<class_int>` **get_slide_count** **(** **)** |const|
  194. Returns the number of times the body collided and changed direction during the last call to :ref:`move_and_slide<class_KinematicBody_method_move_and_slide>` or :ref:`move_and_slide_with_snap<class_KinematicBody_method_move_and_slide_with_snap>`.
  195. ----
  196. .. _class_KinematicBody_method_is_on_ceiling:
  197. - :ref:`bool<class_bool>` **is_on_ceiling** **(** **)** |const|
  198. Returns ``true`` if the body collided with the ceiling on the last call of :ref:`move_and_slide<class_KinematicBody_method_move_and_slide>` or :ref:`move_and_slide_with_snap<class_KinematicBody_method_move_and_slide_with_snap>`. Otherwise, returns ``false``.
  199. ----
  200. .. _class_KinematicBody_method_is_on_floor:
  201. - :ref:`bool<class_bool>` **is_on_floor** **(** **)** |const|
  202. Returns ``true`` if the body collided with the floor on the last call of :ref:`move_and_slide<class_KinematicBody_method_move_and_slide>` or :ref:`move_and_slide_with_snap<class_KinematicBody_method_move_and_slide_with_snap>`. Otherwise, returns ``false``.
  203. ----
  204. .. _class_KinematicBody_method_is_on_wall:
  205. - :ref:`bool<class_bool>` **is_on_wall** **(** **)** |const|
  206. Returns ``true`` if the body collided with a wall on the last call of :ref:`move_and_slide<class_KinematicBody_method_move_and_slide>` or :ref:`move_and_slide_with_snap<class_KinematicBody_method_move_and_slide_with_snap>`. Otherwise, returns ``false``.
  207. ----
  208. .. _class_KinematicBody_method_move_and_collide:
  209. - :ref:`KinematicCollision<class_KinematicCollision>` **move_and_collide** **(** :ref:`Vector3<class_Vector3>` rel_vec, :ref:`bool<class_bool>` infinite_inertia=true, :ref:`bool<class_bool>` exclude_raycast_shapes=true, :ref:`bool<class_bool>` test_only=false **)**
  210. Moves the body along the vector ``rel_vec``. The body will stop if it collides. Returns a :ref:`KinematicCollision<class_KinematicCollision>`, which contains information about the collision when stopped, or when touching another body along the motion.
  211. If ``test_only`` is ``true``, the body does not move but the would-be collision information is given.
  212. ----
  213. .. _class_KinematicBody_method_move_and_slide:
  214. - :ref:`Vector3<class_Vector3>` **move_and_slide** **(** :ref:`Vector3<class_Vector3>` linear_velocity, :ref:`Vector3<class_Vector3>` up_direction=Vector3( 0, 0, 0 ), :ref:`bool<class_bool>` stop_on_slope=false, :ref:`int<class_int>` max_slides=4, :ref:`float<class_float>` floor_max_angle=0.785398, :ref:`bool<class_bool>` infinite_inertia=true **)**
  215. Moves the body along a vector. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a ``KinematicBody`` or :ref:`RigidBody<class_RigidBody>`, it will also be affected by the motion of the other body. You can use this to make moving and rotating platforms, or to make nodes push other nodes.
  216. This method should be used in :ref:`Node._physics_process<class_Node_method__physics_process>` (or in a method called by :ref:`Node._physics_process<class_Node_method__physics_process>`), as it uses the physics step's ``delta`` value automatically in calculations. Otherwise, the simulation will run at an incorrect speed.
  217. ``linear_velocity`` is the velocity vector (typically meters per second). Unlike in :ref:`move_and_collide<class_KinematicBody_method_move_and_collide>`, you should *not* multiply it by ``delta`` — the physics engine handles applying the velocity.
  218. ``up_direction`` is the up direction, used to determine what is a wall and what is a floor or a ceiling. If set to the default value of ``Vector3(0, 0, 0)``, everything is considered a wall.
  219. If ``stop_on_slope`` is ``true``, body will not slide on slopes when you include gravity in ``linear_velocity`` and the body is standing still.
  220. If the body collides, it will change direction a maximum of ``max_slides`` times before it stops.
  221. ``floor_max_angle`` is the maximum angle (in radians) where a slope is still considered a floor (or a ceiling), rather than a wall. The default value equals 45 degrees.
  222. If ``infinite_inertia`` is ``true``, body will be able to push :ref:`RigidBody<class_RigidBody>` nodes, but it won't also detect any collisions with them. If ``false``, it will interact with :ref:`RigidBody<class_RigidBody>` nodes like with :ref:`StaticBody<class_StaticBody>`.
  223. Returns the ``linear_velocity`` vector, rotated and/or scaled if a slide collision occurred. To get detailed information about collisions that occurred, use :ref:`get_slide_collision<class_KinematicBody_method_get_slide_collision>`.
  224. When the body touches a moving platform, the platform's velocity is automatically added to the body motion. If a collision occurs due to the platform's motion, it will always be first in the slide collisions.
  225. ----
  226. .. _class_KinematicBody_method_move_and_slide_with_snap:
  227. - :ref:`Vector3<class_Vector3>` **move_and_slide_with_snap** **(** :ref:`Vector3<class_Vector3>` linear_velocity, :ref:`Vector3<class_Vector3>` snap, :ref:`Vector3<class_Vector3>` up_direction=Vector3( 0, 0, 0 ), :ref:`bool<class_bool>` stop_on_slope=false, :ref:`int<class_int>` max_slides=4, :ref:`float<class_float>` floor_max_angle=0.785398, :ref:`bool<class_bool>` infinite_inertia=true **)**
  228. Moves the body while keeping it attached to slopes. Similar to :ref:`move_and_slide<class_KinematicBody_method_move_and_slide>`.
  229. As long as the ``snap`` vector is in contact with the ground, the body will remain attached to the surface. This means you must disable snap in order to jump, for example. You can do this by setting ``snap`` to ``(0, 0, 0)`` or by using :ref:`move_and_slide<class_KinematicBody_method_move_and_slide>` instead.
  230. ----
  231. .. _class_KinematicBody_method_set_axis_lock:
  232. - void **set_axis_lock** **(** :ref:`BodyAxis<enum_PhysicsServer_BodyAxis>` axis, :ref:`bool<class_bool>` lock **)**
  233. Locks or unlocks the specified ``axis`` depending on the value of ``lock``. See also :ref:`move_lock_x<class_KinematicBody_property_move_lock_x>`, :ref:`move_lock_y<class_KinematicBody_property_move_lock_y>` and :ref:`move_lock_z<class_KinematicBody_property_move_lock_z>`.
  234. ----
  235. .. _class_KinematicBody_method_test_move:
  236. - :ref:`bool<class_bool>` **test_move** **(** :ref:`Transform<class_Transform>` from, :ref:`Vector3<class_Vector3>` rel_vec, :ref:`bool<class_bool>` infinite_inertia=true **)**
  237. Checks for collisions without moving the body. Virtually sets the node's position, scale and rotation to that of the given :ref:`Transform<class_Transform>`, then tries to move the body along the vector ``rel_vec``. Returns ``true`` if a collision would stop the body from moving along the whole path.
  238. Use :ref:`move_and_collide<class_KinematicBody_method_move_and_collide>` instead for detecting collision with touching bodies.
  239. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  240. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  241. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`