frame

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Register

Why do my boxes keep getting stuck?

Game > https://flowlab.io/game/view/1078317
When I push any of the boxes, sometimes the boxes will just stop moving. If you turn around and then push them again, then they'll start moving again. Does it have to do with the box physics?

Comments

  • edited February 19
    @Biscuit Butter I think this is just a hitbox bug, some games will just stop the player in a specific spot when moving on a flat surface. It seems to fix it if you change the Box hitbox from ploygon to a square.
    EDIT: If it gets stuck in the small gap for the 2nd box, try using the circle hitbox.
  • Thanks! I can't remember why I switched the hitbox in the first place.
  • Here are some discussions of why this issue occurs when resolving rectangle/rectangle corner collisions:

    https://gamedev.stackexchange.com/questions/28490/smoothly-move-between-bodies
    http://www.iforce2d.net/b2dtut/ghost-vertices
    https://forum.unity.com/threads/box-collider-collision-catching-on-edges.222809/

    This doesn't help solve the actual issue, but it should help explain what's going on.
  • edited February 21
    Ah, so its not a bug @grazer

    But what I don't understand is why this happens in a very specific spot across multiple of the Same blocks.
    Like the player woalks on previous blocks then next stops on the same block.

    This will happen now on one of my older games that worked perfectly fine last year.
  • Do a capsule shape.
  • Capsule isn't good, as I want you to be able to stand on the blocks and capsules aren't good for that. I'll keep with square, even though it isn't perfect.
  • Just have it to where if it hits an object on the bottom, it positions itself 5 pixels above.
  • @grazer @Biscuit Butter I found a way around this!

    I made a system where it checks to see if the object is in the same spot a frame ago.
    If the object is in the same spot, then move it by 1 pixel. This will get the object off of whatever it was stuck on. This is really helpful for constantly moving objects to keep moving and you can even disable and enable the system.

    The timers are set to 0 with the repeat of 1, but I would recommend 1 with a repeat of 1 if you want to control when to stop the object. The switches can be used to switch or stop the system.

    hitbox cache
  • @JR 01 Sweet! This should be really useful!
  • @JR 01 I did the same thing and it didn't work out well. Can you see what I did wrong with the box's behaviors?
    Game > http://flowlab.io/game/play/1155575?v=html
  • edited June 6
    The behavior is suppose to work for whenever your not moving and it moves you a pixel.

    Since you need to move only when its being pushed, I would try the bottom with the switches.
    Turn the switch on when moving (or collision with left/right side) and off with the up input.
    Also the extractor gets the X, not the Y.

    the top one is just for games if you actually dont stop running as the player function
  • edited June 6
    @Biscuit Butter
    I can get a screenshot for you, if you still need help.
  • edited June 6
    @JR 01 I changed it and it didn't work. Can you send a screenshot please? Sorry if I've been asking for too much.
  • edited July 23
    @Biscuit Butter,
    sorry for the confusion but I meant the up output from the left and right arrow keys.

    Also use 2 different collisions, one set for left and other set to right, so both switches aren't turnned on at the same time.
    Also remember that Left and Right collisions are switched so left (-1) may need the right collision.

    2019.06.05-21.18
  • I finally got it. Thank you so much @JR 01 for dealing with my stupidity and helping me out!
  • Its Np lol
    It's not hard, but you kinda got to think about it from another perspective.
    It took me a minute to re-figure out why I had the not equal filter.
Sign In or Register to comment.

flowlab.io

| make games in your browser
@ 2017 Flowlab.io, All rights reserved.

Contact us

Get In Touch