Hey,
I have been making a simple two-player platformer for practice and I am trying to implement mechanic where players are able to push each other while rushing for objectives. Just a simple push style of when you move and collide it affects the movement of the other player, similar as I would be pushing rigid body. So far I got this code in physics process but the results are that the other body moves 2 pixels and stops or makes incredible leaps all over the place. Where am I going wrong with this? All conversation in the internet I found about this pointed to this direction. Get collider and apply movement through move and slide.
Dropbox for video that shows current behavior
My code for detect collision and apply movement to collider:
for i in get_slide_collision_count():
var collision = get_slide_collision(i)
if collision.get_collider() is Player:
collision.get_collider().move_and_collide(velocity * delta)