britzl / platypus

Defold platformer engine
MIT License
56 stars 10 forks source link

"Teleportation" when a ground block is removed and a character stands on it #4

Closed Megus closed 6 years ago

Megus commented 6 years ago

If a character stands on a ground block and you remove it using go.delete(), a character can (it seems that it happens in ~100% cases) "teleport" to some other coordinates. Expected behavior: character should fall down.

britzl commented 6 years ago

What happens when you get ground contact is that you get parented (using set_parent) to the thing you land on. This makes it very easy to handle moving platforms. And when you no longer have ground contact the parent is removed (set_parent with id nil).

The problem you have encountered is that the player character looses its parent and its world transform which results in a new world transform for the player.

Not sure how to solve this. Perhaps via a function such as platypus.detach_from_parent() or something like that?

britzl commented 6 years ago

Released new version: https://github.com/britzl/platypus/releases/tag/3.0.1

Would you mind giving it a try?