Transparent parts of the sprite has still a hitbox

Touchtest.aia (9.9 KB)


When the object (platform) has a transparent "gap" on it, the object (ball) still floats. How to fix this?

MIT App Inventor doesn’t support pixel-perfect collisions — the hitbox includes transparent areas. To fix it, split your platform into smaller sprites matching the visible parts or use invisible collision zones only where the ball should land. That’ll remove the “floating” effect.

Change the z index of the sprite?

1 Like

How to do it?

1 Like

Don't know what you want to do. If the ball is to fall through you could test the following (as to define the width of the gap)

Here is another approach. I used my own wall image. Draw a couple of rectangles which are nearly the same colour as the canvas background (not visible to the naked eye). Then test the value of the background colour behind the ball sprite. Bounce/Float if different, continue to fall if the same. Can be improved to handle the ends of the two walls.

Touchtest_revised.aia (12.0 KB)

add a Ball component with transparent bgcolor, make the ball move together with your actual ball.
Use the Ball component to test collide or not.