Posted: 23rd Feb 2021 1:22
So here is my Problem

I'm experimenting on a side puzzle game

When I set my Sprites to Collision

There is a big Gap from the ground to the Player sprite

How do i sit my sprite player to the ground sprite?

Somehow the uv border is hidden due to it is a animated sprite but it is way to big for collision.
Posted: 23rd Feb 2021 1:51
without seeing the image(s) used for the sprite, i imagine there is some/a large amount of transparency surrounding the actual graphic (i've noted a lot of "useless" transparency surrounding craftpix.net images, for example).

so, set the sprite's collision shape to match the actual graphics, or remove the outer transparency from the image(s)?

again, without seeing the spritesheet itself, the above is just a guess.
Posted: 23rd Feb 2021 3:12


Hi, ok here is a picture for better understanding

Sorry
Posted: 23rd Feb 2021 3:39
i understood that the character's feet aren't touching the ground but without the actual character image(s) i can't be sure if my previous suggestions would rectify.

if you're not adjusting the collision shape at all, i'm nearly sure that you need to, otherwise.

in this example, the sprite's collision box is the same size as the (64x64) image itself, by default. the part that i want to stand on the ground/bottom of the screen is the red box:

here, the collision shape/box is resized to fit the red box (32x32), or "character" in your case, to account for surrounding alpha transparency within the same 64x64 image:

...manually setting the collision box with SetSpriteShapeBox(ThisSprite,-16,-16,16,16,0.0) the only difference in the code.

you could easily see if my suggestion would work using SetPhysicsDebugOn() which would reveal the sprite's shape. ie, see if the shape itself is, indeed, resting on the ground.
Posted: 23rd Feb 2021 4:10
Thanks Virtual Nomad


That helped

They should have made all collision boxes fit perfectly unless needed, not the other way around.