Killing character from falling object BUT can also walk through object.

Discussion in 'How Can I...?' started by clin407, May 25, 2016.

  1. clin407

    clin407 Boxer

    Joined:
    May 9, 2016
    Messages:
    43
    Likes Received:
    14
    I'm trying to figure out how to achieve this scenario:

    Character is walking on platform and an object from above is going to fall on down based off distanced based wake up.

    If the character gets hit on the head by said object, he dies. I have this figured out as I just set the object as an enemy physics BUT I want to know if it's also possible for it so when the object falls and does not hit the character, for the character to walk through it (so it's a decoration or no collision).
    t the only problem is, when I walk through, I touch the second object which is set to kill me.

    Any ideas on how to go about this? Here's a link to a demo I whipped out. https://dl.dropboxusercontent.com/u/52092/object falling.bbdoc I basically want the triangle to be able to walk through if it lands on the floor BUT at the same time I want it so when it falls, it can fall on the characters head and hurt them.
     
  2. clin407

    clin407 Boxer

    Joined:
    May 9, 2016
    Messages:
    43
    Likes Received:
    14
    Anyone have any thoughts on this? I've just made it so it falls thru the floor by changing to no collide but would love to find a way to obtain my scenario I listed.
     
  3. Depuuty

    Depuuty Avid Boxer

    Joined:
    May 17, 2016
    Messages:
    119
    Likes Received:
    44
    I believe the answer to your problem is in layers.. right click and move it back maybe?

    The decoration i think would work..
     
  4. heathclose

    heathclose Miniboss Boxer

    Joined:
    Jan 28, 2016
    Messages:
    1,810
    Likes Received:
    1,026
    This is the closest I came... I mean it works, but not with physics objects so if physics is what your aiming for, it won't work, but this fakes it fairly well.. First separate the link, make the triangle a decoration, put in a logic to stop the triangle, let the killer platform fall through the game, triangle can be walked through...

    https://www.dropbox.com/s/xlz2s4ilwp2q2fx/object falling.bbdoc?dl=0

    that's bb 2.1 btw

    also that collision box on the triangle you can ignore, I was messing with it and never changed it back, but it can cover the whole thing. I had it low like that because I wanted the character to walk over it after it fell as a physiscs object but the character kept getting stuck on it.. which doesn't make sense really, you can walk over things in platformers made by bb all day... so if you figure out how to use that collision shape to let the character walk over it... you can do it as a physics objects and it will work but don't make the collision box flat, that crashes bb every time you preview
     
    Last edited: May 30, 2016
  5. JustWatchApps

    JustWatchApps Avid Boxer

    Joined:
    Sep 25, 2015
    Messages:
    315
    Likes Received:
    145
    Ok, I'm working in BB1
    If you change the collision shape of the character so that it does not go all the way down to the platform, then when it passes through the decoration, it will not hit the second object that kills the character. In order to keep the character from sinking into the platform (due to the reduced collision shape,) I connected an invisible physics object to the character to keep it afloat. Walks right through.

    Hope that makes sense.
     
  6. Depuuty

    Depuuty Avid Boxer

    Joined:
    May 17, 2016
    Messages:
    119
    Likes Received:
    44
    We actually figured it out..
    You have to stack another on top and connect them..
    And the protruding one is the one to kill
     
  7. clin407

    clin407 Boxer

    Joined:
    May 9, 2016
    Messages:
    43
    Likes Received:
    14
    Depuuty likes this.

Share This Page