i am creating a multiplayer game, i have a player who is a KinematicBody2D and i use moveandslide to make it move. in my physics_process i have:
func _physics_process(delta):
if is_network_master():
velocity = Vector2(0,0)
velocity += analog_velocity
if velocity.length() > 0:
velocity = velocity.normalized() * speed
rset_unreliable("slave_velocity", velocity)
else:
velocity = slave_motion
velocity = move_and_slide(velocity)
if not is_network_master():
slave_velocity = velocity
so when i run two players the both move fine, but if one of the players collides with an object it will mess up position on other players screen (cause it will slide of a corner of the collision object and continue to move)
how would i fix that? i was thinking about using position but then collisions would not work