move_and_slide interactions with other kinematic bodies, and how to alter them

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Aimainiac

In the Godot Wiki’s description of Kinematic Bodies, it states:

“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.”

This makes sense, after all, Kinematic bodies are supposed to be instructed entirely through code. However, in the description of move_and_slide(), when discussing collisions with other objects, it says:

“If the other body is a KinematicBody2D or RigidBody2D, 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.”

This means that KinematicBody2Ds CAN be affected by other bodies, so long as it is using move_and_slide() for its movement.

For example, if a kinematic body had in its physics process move_and_slide(Vector2(0,0)) and another kinematic body was pushing against it, the body would be pushed very slowly.

Is there any way to turn off this behavior?

:bust_in_silhouette: Reply From: spaceyjase

Collision masks: