Open raphaklaus opened 5 years ago
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.
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.
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
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()
.
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
inCollisionShape2D
.Steps to reproduce:
Given the following Node2D Structure:
If we animate
CollisionShape2D
andSprite
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
toon
in your platform object.Minimal reproduction project:
Clone this and hit play in your Godot: https://github.com/raphaklaus/animation-player-issue