hello!
I have made a platforming game but when my character drops from heigh places, he falls through or into the ground.
I've made a code to prevent it, but it still seems to fall through from time to time, this only happens when he builds up a lot of downwards speed.
thats the code i use to stop him from falling.
Does anyone know a way of stopping him from falling through the floor anyway?
thanks!
public void checkFall() { if (onGround()){ vSpeed = 0; } else { fall(); } } public boolean onGround() { Actor Under = getOneObjectAtOffset (0, getImage().getHeight() / 2, zwarteBalk.class); return Under != null; }