No longer touching, destroy actor

I have two actors, a player and a platform.

At the start of the game the player is standing on the platform. When the player jumps to the next platform. I would like for the first platform to disappear. Im not sure how to complete this code. My current code immediately destroys the actor.

I currently have:

Comments

  • UtopianGamesUtopianGames Member Posts: 5,692
    edited May 2015

    You could try and wrap the rule in a timer ie...after 0.2 seconds ...

    I'm guessing the platform with the rule in is below the hero in the layer?

    Why have you got it constraining to its self position?

    You could also constrain the x position of the hero via a game integer called HeroX and do something like if game.HeroX > self.position.x + self.size.width /2 "destroy" or use magnitude.

  • GamingtilDawnGamingtilDawn Member Posts: 104

    @DeepBlueApps said:
    You could try and wrap the rule in a timer ie...after 0.2 seconds ...

    I'm guessing the platform with the rule in is below the hero in the layer?

    Why have you got it constraining to its self position?

    Yes it is below it.

    It's constraining because I didn't know how to tell GS to not destroy the actor when the player is standing on it. I wanted to make sure it stays in place. I just assumed a constraint was what is needed.

  • UtopianGamesUtopianGames Member Posts: 5,692
    edited May 2015

    You can leave that part of the rule blank and just use the otherwise to destroy.

    You could unchecked movable on the platform and use magnitude or distance from hero to destroy so you have a few options.

  • GamingtilDawnGamingtilDawn Member Posts: 104

    @DeepBlueApps said:
    You can leave that part of the rule blank and just use the otherwise to destroy.

    You could unchecked movable on the platform and use magnitude or distance from hero to destroy so you have a few options.

    Thanks, I will have to try the last option, but I did try the first option and it also destroyed the platform immediately.

  • UtopianGamesUtopianGames Member Posts: 5,692
    edited May 2015

    Maybe try and increase the timer to after 1 second? I presume the hero has gravity pushing it down onto the platform...should work OK I'm out of the office until Tuesday as its a bank holiday here in the UK but if your still stuck pop me a pm and I will make a quick demo project for you.

Sign In or Register to comment.