Moving HUGE differences between Kinematic2D move_and_collide() and move_and_slide()

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

Well, I am programming a platformer and naturally need to check and handle collision between player and ground/walls. Method move_and_collide() does the work, but surely I will need sliding properties of move_and_slide() as when implementing proper gravity to act into kinematic game objects.

The problem is, the moving speed when I write move_and_collide(motion_vector)
and move_and_slide(motion_vector, Vector2(0, -1)) is really HUGE. The player moves too slow at the second method… why???

:bust_in_silhouette: Reply From: kidscancode

From the KinematicBody2D docs:

linear_velocity is a value in pixels per second. Unlike in for example move_and_collide, you should not multiply it with delta — this is done by the method.

AHH!!! That makes sense!!! Thanks a lot!!!

Carlos Pazuzu | 2018-02-03 13:14