Immovable physics toggle problem

  • I've got a situation where I want to switch an object's physics between movable & immovable, however there's a problem with this as you can see in the capx. Click on the red sprite to toggle, & the sprite falls through the floor when it becomes movable (this gets worse with each click).

    I've tried moving the sprite up 1 pixel before it's set to movable again to avoid overlaps, but that doesn't work. It seems to have no collision with the floor for a few frames. Any ideas for a workaround?

  • I would suggest this is a bug.

  • I posted this under bugs & Ashley confirmed that it's a limitation of the box2d engine. The same thing happens to a lesser extent with asm.js, so I'm still looking for a workaround. Any ideas?

  • Well i havent had much of a chance to take a look. You could always take a look at the Chipmunk Physics behavior which is here:

  • An update: I have tried the Chipmunk option and it works as you would expect. I dont know whether this is an option for your project.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thanks, this sounds great. The post collision trigger stuff should add some interesting new possibilities over the current physics engine. Chipmunk's lack of tilemap support is a problem for me though, but I'm sure Rojohound will get that working in the future.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)