Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | moechofe |
I made a small example with two balls that should collide together and bounce.
Sometimes the balls stay stucked together before being bounced.
I made a video of this: https://youtu.be/xtobyDJlEsQ
And the code:
extends KinematicBody2D
export(Vector2) var velocity:Vector2=Vector2(500,0)
func _physics_process(delta):
var collision_info=move_and_collide(velocity*delta)
if collision_info:
velocity=velocity.bounce(collision_info.normal)