KinematicBody2D.moveAndSlideWithSnap

Moves the body while keeping it attached to slopes. Similar to moveAndSlide. 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) or by using moveAndSlide instead.

struct KinematicBody2D
@nogc nothrow
Vector2
moveAndSlideWithSnap
(
in Vector2 linear_velocity
,
in Vector2 snap
,
in Vector2 floor_normal = Vector2(0, 0)
,
in bool infinite_inertia = true
,
in bool stop_on_slope = false
,
in long max_bounces = 4
,
in double floor_max_angle = 0.785398
)

Meta