How to get normal of collision? [Godot 3.0]

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By PugMasterPug
:warning: Old Version Published before Godot 3 was released.

I have a KinematicBody2D, to move it I use the move_and_slide() function (by the way, should I use move_and_slide(speed) or move_and_slide(speed*delta)?), I want to get the normal of the collision for doing things like detecting when you fall in something, when you run into something, etc… I could do it in Godot 2, but i don’t know how to do it in Godot 3.

I would appreciate any help.

Looking at the docs it says you should not multiply it by delta.
Regarding the normal I’m not sure, but there seems to be this method:

KinematicCollision2D get_slide_collision( int slide_idx )

You should check it on the docs :wink:

DodoIta | 2018-01-01 23:49

How do I check the godot 3 docs? I found this page but I can’t find the documentation itself for godot 3.

PugMasterPug | 2018-01-02 00:35

3.0 documentation is right here:
RigidBody2D — Godot Engine (latest) documentation in English

Note the “latest” in the URL. If it says “stable” instead, you’re looking at the 2.1 docs. You can switch the version at the bottom of the left menu pane.

kidscancode | 2018-01-02 04:35

Also, documentation is accessible within Godot itself, just go to the script editor and you can find some useful buttons at its top :wink:
You can also use contextual help by highlighting anything that’s predefined in GDScript and by pressing Shift+F1, for example RigidBody2D or _integrate_forces.

DodoIta | 2018-01-02 17:05