godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.71k stars 21.12k forks source link

I am missing a demo for RayShape2D with KinematicBody2D #28471

Closed silkentrance closed 5 years ago

silkentrance commented 5 years ago

Godot version: 3.1.stable.official

OS/device including version: OSX HighSierra latest, MacBook Pro

Issue description: In here https://godotengine.org/article/godot-31-will-get-many-improvements-kinematicbody you describe that it now supports rayshape2d for getting the slope thing right.

I tried setting up a kinematic body 2d with the information from that article, however, the system will never detect a collision with the ground floor and thus keeps in a state where is_on_floor() is never true.

In your existing demo for a physics based platformer, you are using RigidBody2D in combination with a RayShape2D and this works just fine.

Maybe I am doing something wrong here.

Steps to reproduce: See the attached project.

Minimal reproduction project: src.zip

silkentrance commented 5 years ago

Please also label this RTFM and rightly so :)

I mixed up the snap and floor_normal parameters in the call to move_and_slide_with_snap.

Never mind, works as expected. Closing.