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

Bumpy issue when dealing with moving platforms and Animation Player #32158

Open
Tracked by #45334
raphaklaus opened this issue Sep 15, 2019 · 5 comments
Open
Tracked by #45334

Bumpy issue when dealing with moving platforms and Animation Player #32158

raphaklaus opened this issue Sep 15, 2019 · 5 comments

Comments

@raphaklaus
Copy link

Godot version:
3.1.1 stable

OS/device including version:
Ubuntu 18.04.2 LTS

Issue description:

A bumpy player in moving Platform when using AnimationPlayer in CollisionShape2D.

Steps to reproduce:

Given the following Node2D Structure:

* Node2D
  * KinematicBody2D
    * Sprite
    * Animation Player
    * Collision Shape 2D

If we animate CollisionShape2D and Sprite up and down, simulating a vertical moving platform, we get a bump effect on the character.

But if we animate the KinematicBody2D up and down directly, it doesn't happen. It works, but some times it is not wanted since I don't want to mess the base location of that object.

Make sure to set Sync to Physics to on in your platform object.

Minimal reproduction project:

Clone this and hit play in your Godot:
https://github.com/raphaklaus/animation-player-issue

@Raphael2048
Copy link
Contributor

I don't know the reason why it bumps, but I think you should animate the KinematicBody2D instead of its child nodes, and Sync_to_physics is a prepared for itself , not its child nodes.
I tried it on my own, and it works fine.

@raphaklaus
Copy link
Author

I don't know the reason why it bumps, but I think you should animate the KinematicBody2D instead of its child nodes, and Sync_to_physics is a prepared for itself , not its child nodes.
I tried it on my own, and it works fine.

Animating the KB2D directly throw two issues:

  1. Having to animate the global position, not the relative one. It talks by itself.
  2. What if I just want to animate specific hitboxes to adjust for better collisions? I think it should be accurate in the same way.

@Raphael2048
Copy link
Contributor

  1. add a layer is a solution:
    Node2D
    -Node2D (Still parent node)
    - KB2D(To animate)
    2 I'm trying to solve this

@raphaklaus
Copy link
Author

raphaklaus commented Sep 24, 2019

Yes, number 1 works. Although a little bump at the end (when the platform is moving up again). You can simulate it in this branch: https://github.com/raphaklaus/animation-player-issue/tree/almost-good-branch

@KoBeWi
Copy link
Member

KoBeWi commented Sep 13, 2020

Seems like it still happens in 3.2.3 rc6, but this is somewhat expected, because the character is a RigidBody2D and it keeps its speed from the platform. Not sure if there's other way to prevent the bump than using KinematicBody2D with move_and_slide_with_snap().

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

4 participants