|Topic was automatically imported from the old Question2Answer platform.
I’m having trouble understanding how collisions work regarding KinematicBody2D objects and the move_and_collide or move_and_slide functions.
I want to change the positions of these objects and then move them in the same frame, but they are colliding with their past positions. The collision code isn’t fully registering the position change. For example, the following code executed in _physics_process causes a collision.
$CollisionShape2D.disabled = true
var old_position = position
position = swap_to.position
swap_to.position = old_position
$CollisionShape2D.disabled = false
var collide = move_and_collide(Vector2.ZERO)
Is there a better way to change the positions of KinematicBody2D objects and then call move_and_collide() without these objects registering collisions?