Platform example PlayerHitBox and Player sync problem

Hello, is there a particular reason why the example uses a PlayerHitBox other than using the mask from the Player object?
I’m not sure if this should be posted in the bug report forum.

The problem is perhaps the position of the Player object is not updated sometimes.

It is easy to test:

  1. create the animations of the Player using a picture, but set the center point away from its natural center
  2. move your player around, you will see the picture flicking as if trying to catch up with screen update
  3. jump the character while it is facing left, and see the glitch of the position
  4. grab a platform while facing left, it should produce the same glitch

the hitbox is so useful because if your animation has different image sizes it doesnt affect the colision but, if you dont use it you are gonna get a lot of collision and animation issues. just do the “put an object around other” event to put your “player” aroud the “hitbox” and add the behavior to the “hitbox” so the “player” just play the animations when the “hitbox” does something. thats the best way to do that

The tutorial on the wiki seems to be an old one for it doesn’t use that hit box.
I also tried that but it didn’t work, because when trying to change animation to Idle or Walk, the player just stopped moving. Maybe that was the real reason the example didn’t use that method?

if you show me your events as pictures maybe i could help you, because i use that method and works fine to me.
you should make a “hitbox” and a “player” then just put every collision and behavior to the “hitbox” and the animation to the “player” for example:

no conditions—put “player” around “hitbox”…
“hitbox” is moving—set the animation(walk) for “player”
“hitbox” is jumping—set the animation(jump) for “player”

Ah, I think you are right.
I started a new project using the platformer template and replaced all “playerhitbox” with “player” and deleted unnecessary lines. It worked without a problem.
I guess I just made a mistake somewhere last time. :smiley:

yep the hitbox is the best way to do that so you dont get collision or animation issues and its easy to use when you know how to

I tried again, and it didn’t work…
I think I’ve found the problem.
The pictures I am using all have blank space below the character, in another word, the collision mask is in the center of the picture. For some reason/bug, the character never really touches the ground.

I think I’ll just drop the idea of removing PlayerHitBox, otherwise I need to crop every picture. Besides, sometimes I just want to play with the collision masks so they are not always on the ground level.

try to upload an example project and i will tell you what are you doing wrong … mF5YXRpY0U
Project2.gdg is the one without PlayerHitBox

There are many problems, not being able to walk is just one of them. So I dropped the idea because it caused more troubles than benefits.

Project.gdg is the working version with PlayerHitBox.

show me an screenshot to see whats the issue

Well, screenshot won’t work. How do you show the character can’t walk? :stuck_out_tongue:

I attached a smaller demo, which was modified from the default platformer template. I removed PlayerHitBox from the scene and edited the collision masks.
p.7z (106 KB)