Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Player KinematicBody2D (using Rayshape2D and move_and_slide) make moving platform(using move_and_collide) drop down slowly together. #36500

Closed
Tracked by #45334
RonTang opened this issue Feb 24, 2020 · 6 comments

Comments

@RonTang
Copy link

RonTang commented Feb 24, 2020

Godot version:
3.2 stable

Bug Gif:
20200224_135959-10-20

OS/device including version:
develop and learn using win10

Issue description:
Player(KinematicBody2D) using rayshape2D and move_and_slidenot work with moving platform(KinematicBody2D) using move_and_collide. When player standing on this moving platform, they will drop down slowly together.

Steps to reproduce:
100% reproduce. Just use player jump on the moving platform.

Minimal reproduction project:
Please open level1 scene in the project. In the right of scene has a moving platform.
github.zip

I am a newbie to godot . I believe godot is greate engine. Thanks everyone.

@RonTang
Copy link
Author

RonTang commented Feb 28, 2020

I tested a lot of situations. Only when players use rectangleshap2d (if use capsule need change collision safe margin more than 0.08)and use the move_and_slide function in the script can work well with the moving platform using the move_and_collide function.
So at current I think best way to create moving platform is using AnimationPlayer or Path2D and check the sync with physics of motion in KinematicBody2D.

@Janglee123
Copy link
Contributor

@RonTang I cant open your demo project make sure it contains project.godot file.

@RonTang
Copy link
Author

RonTang commented Feb 29, 2020

@Janglee123 Thanks your reply. I will upload again.Wait a moment

@RonTang
Copy link
Author

RonTang commented Feb 29, 2020

20200229_111133-0-15

And this is mini project
Jungle Jump.zip
Without rayshape2d the moving platform is ok. Thanks for your help.

@fabriceci
Copy link
Contributor

I can't reproduce the issue in 3.2.2 stable. Note that the platform bounce on the collision normal, and the player can collide with the platform...

velocity = velocity.bounce(collision.normal)

@pouleyKetchoupp
Copy link
Contributor

pouleyKetchoupp commented Jul 5, 2021

Closing as the specific issue shown in the video doesn't occur anymore in 3.3.2.

As already pointed out, using move_and_collide for the moving platform currently doesn't work very well though, because it will still collide and bounce on the player, so using animation should be the preferred way if possible.

Right now, it's hard to work around the limitation that collision layers are setup in a symmetrical way, so if the player collides with the platform, the platform also collides with the player. The only way I can think about would be to change collision layers before the platform calls move_and_collide and change it back after.

In 4.0, you will be able to setup collision layers in a way that the platform will be able to ignore the player and only collide with the environment:
godotengine/godot-proposals#2775

@pouleyKetchoupp pouleyKetchoupp added this to the 3.3 milestone Jul 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants