Jump-thru for physics objects

0 favourites
  • 4 posts
From the Asset Store
Simple yet very life-like rag doll made with Physics!
  • So, I'm making this platformer but instead of using the platform behaviour for my character I'm using the physics behaviour to move them around (so that I can apply interactive impulses, blah blah it's just easier). I've given my character the platform behaviour so that I can test for things like being on the floor, but all the movement is physics-based.

    So my question is is there a way to make an immovable platform which interacts with the player the same as any other immovable physics object, but which I can jump through the bottom of like an object with the jump-thru platform behaviour? Thanks in advance!

  • You can do it easily with the Chipmunk physics behavior. For example, you can do a on pre collide, check if the normal of the collision is pointing down(or maybe up?), and then ignore the collision. So you wouldn't collide if hitting it from a specific side.

    You can't do that sort of thing with the built in physics in construct. Chipmunk also has other useful features too.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can disable the physic behavior for all objects with Y less than your character. Problem is, that other objects ignore those to, so you have to add an invisible sprite/TBG with physic behavior, lay it over all JumpThru platforms and disable collision for your character. The reason why you can not deactivate the collision of the JumpThru Platform for the player right away is that this action always counts for all instances and is not applicable individually.

    + System: On start of layout

    -> PhysicBlockInvisible: Disable Physics collisions with Player

    + System: For each PhysicJumpThru

    ----+ PhysicBlockJumpThru: Y < Player.Y

    -----> PhysicBlockJumpThru: Set Physics disabled

    ----+ System: Else

    -----> PhysicBlockJumpThru: Set Physics enabled

  • You can disable the physic behavior for all objects with Y less than your character. Problem is, that other objects ignore those to, so you have to add an invisible sprite/TBG with physic behavior, lay it over all JumpThru platforms and disable collision for your character. The reason why you can not deactivate the collision of the JumpThru Platform for the player right away is that this action always counts for all instances and is not applicable individually.

    + System: On start of layout

    -> PhysicBlockInvisible: Disable Physics collisions with Player

    + System: For each PhysicJumpThru

    ----+ PhysicBlockJumpThru: Y < Player.Y

    -----> PhysicBlockJumpThru: Set Physics disabled

    ----+ System: Else

    -----> PhysicBlockJumpThru: Set Physics enabled

    I did a slightly more convoluted version of that and it worked very well, so thanks! Just wondering - would there be a simpler way to have other physics objects also pass through the platform than having a platform for each individual object I need to control? Doesn't really matter if there isn't one, it's just for the sake of polish. Not really necessary.

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