+4 votes

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.

in Engine by (127 points)

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 ;)

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

3.0 documentation is right here:

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.

Also, documentation is accessible within Godot itself, just go to the script editor and you can find some useful buttons at its top ;)
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.

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.