How do I fix this?

Get help using Construct 2

Post » Wed Mar 16, 2016 1:04 pm

Hello everyone! :)
I'm having some problems with physics in my game, every time i use it in a object, the object start to "jump" a pixel, i'll attach a screenshot to make it easier to understand.

Image

Here the problem is with the chest, he have the physics behaviour, and hes not touching the ground. It's possible to fix it?
PS: Sorry if i said something wrong, english is not even close to be my main language.
Image
B
39
S
14
G
2
Posts: 120
Reputation: 3,454

Post » Wed Mar 16, 2016 1:40 pm

Look at the collision polygon of your chest and the floor where it stands. It is possible that the collision polygon is not exact and has a little space. Then your chest will 'hover' a little.
B
24
S
3
G
1
Posts: 451
Reputation: 2,165

Post » Wed Mar 16, 2016 3:15 pm

Thanks for the reply! :)
I guess thats not the problem, because i use invisible boxes for collision, like this:

Image

BTW, i'm using the retro template, that could be a problem for the physics behaviour?
Image
B
39
S
14
G
2
Posts: 120
Reputation: 3,454

Post » Wed Mar 16, 2016 3:57 pm

Without seeing your capx I can only guess. I still think it's a problem with the collision polygon.
If your hitbox (invisible box) has the same size as your chest-sprite, take a closer look at you chest sprite with the image editor. Normally there is a padding around your sprite with a gap of 1 pixel. If your hitbox and the chest-sprite has the same size, your chest will about 1 pixel over the ground, because of the padding. Try to make your hitbox 2 pixel smaller in x and y, so the hitbox is 2 pixel smaller in each direction. Another problem could be the origin-point of your chest-sprite an the hitbox. If both points not exact in the middle you can also get problems.
B
24
S
3
G
1
Posts: 451
Reputation: 2,165

Post » Wed Mar 16, 2016 4:15 pm

If you use collision hitboxes, then add a chest sprite, then set it's position to hitbox.x, hitbox.y+1 or more.
B
23
S
5
G
4
Posts: 141
Reputation: 3,260


Return to How do I....?

Who is online

Users browsing this forum: HenryPK and 9 guests