I have those spherical KinematicBody2D, each moving at same speed along a random vector on stage (based on their rotation when they spawn in).
When collision fires between them, they escape by "sliding over" each other.
I run this piece of code :
var event = true
direction = Vector2(sin(rotation), -cos(rotation)).normalized()
var collision = move_and_collide(direction* speed)
event = false
direction = direction.slide(collision.normal).normalized()
#move_and_collide(direction * speed)
event = true
I use normalized() to get the direction only and set velocity with * speed so the "sliding over" should happen at same speed as when they are just moving around.
If I uncomment the "moveandcollide(direction * speed)" inside the " if collision" statement, they seems to escape faster. How that happens ?
delta is 0.01667s, so it sticks to the frame rate (60 FPS). Does it mean that in one delta time it will execute both moves ?
It may sounds obvious but not to me. Can someone explain ?