Is there some move_and_collide() test example ?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Victoralm

Is there an example of move_and_collide() test?
What it returns when colides and how to treat its return?

I’m trying to implement a change on the generated path if the test shows that is colliding at some point…

:bust_in_silhouette: Reply From: kidscancode

There’s an example here: Using KinematicBody2D. If it returns a value, there was a collision.

The returned value of move_and_collide() is a KinematicCollision2D. You can see the list of data it contains on the API page.

I’m carefully reading the tutorial and watching your videos (and all other sources that I can get), but I’m really got stuck at this point.
My goal is to get the NPCs to detect if there is an obstacle between it and the next position on the pathfollow. If positive, they need to contour it then keep walking through the path.
I’m not with much luck in this… This is what I did 'till now: project on Github

Victoralm | 2019-05-17 05:14