|Topic was automatically imported from the old Question2Answer platform.
I am following along with this tutorial, and have hit a bug that I am having difficulty understanding. I’ve created an enemy slime character, and am adding a hurtbox on top for when the playable character jumps on it. However, the enemies squashed themselves for no apparent reason. Using print statements, I saw that they were actually squashing themselves. Not understanding how this works, I slowed down the game speed using
Engine.time_scale to see how this was happening frame-by-frame. At very slow speeds, the self-squash didn’t happen, but when one of the slimes picked up more speed it squashed itself.
I have no clue why this is happening. I’ve set the collision layer of both the hurtbox and the “floor checking” collision box to the same value, which I’ve named “enemy”. But I’ve turned off the “enemy” collision mask on the hurtbox. If I turn off the “enemy” collision layer on the hurtbox, then everything works as expected. How is it able to collide with itself, even with “enemy” not selected as a collision mask? And why is this seemingly affected by the speed at which the enemies move?
I know this is a bit complicated, so I’ve uploaded a couple of short videos to demonstrate what I mean.
Please provide full source code of your project, without it it is very hard to find physics-related bugs or issues, because there are plenty of reasons why it might not work in a way you expect.
AlexTheRegent | 2022-06-23 08:23
Hi Alex! What’s the best way to share the full source code? Should I push the project to my Github so you can clone it?
jame | 2022-06-23 16:58
You can upload it to github or to cloud like google drive or dropbox.
AlexTheRegent | 2022-06-23 18:40
Apologies for the delay, repo is uploaded here
jame | 2022-06-26 14:38