Pressure pad (Toggle Trigger)

0 favourites
  • 7 posts
  • I am trying to create a pressure pad that will open a door when the player walks over it and closes the door when he walks off it.

    this is my setup

    PLAYER on collision with PRESSUREPAD = set ACTIVE(Instance Variable) to 1
    ACTIVE = 0 = Door Open
    ACTIVE = 1 = Door Closed[/code:nsl1zejn]
    So I cant figure out how to know when the player has finished the colliding with the object so it can set the instance variable back to 0?
  • Use Else.

    If player on collision with pressure pad set ACTIVE = 1

    Else Set ACTIVE = 0

    Or use

    If player on collision with pressure pad set ACTIVE = 1


    If player on collision with pressure pad set ACTIVE =0


    Evert Tick set ACTIVE = 0

    If player overlapping with pressure pad set ACTIVE = 1

    This might be better for a pressure pad as it sets ACTIVE to 1 only whilst the player is in contact with it

  • Thanks for the reply,

    I did try else but it said it couldnt be used there (not sure exaxtly what the problem was, ill retry after work)

    Also wouldnt using tick be bad for peformance and generaly a bad practixe?

    as it would just be constantly setting it to zero when its a tiny feature of a large map

  • No effect on performance using every tick at all.

  • Unfortunately I still cannot get it to deactivate, heres two event sheets i tried out.

  • Try this example..

    In your code you are setting IO to off every tick when IO =0 which it never is.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Had to download r170 to check out the example, but i understand it now, thanks for the help!

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