How do you Open a door with pressure plates in a specific sequence?

Currently having trouble with opening a door using multiple pressure plates in a specific sequence. I want open a door by stepping onto three plates in order, my current bps consist of a door that opens properly and bp that has one pressure plate that also animates when stepped on. note I have the door open when pressing onto a plate working properly as well as having it open when having three pressure plates activated no matter the sequence.

An easy one could go like this:

The plate:

  1. Add a bool for the activate state. On overlap check if it was the player and if the bool is falso to then call a dispatcher with Self as a parameter.
Plate BP

Main graph:

setActiveState function:

The door:

  1. Add each plate to an array in the order you want them to be triggered and bind the dispatcher.
  2. Add an integer that will keep track of the triggered plates.
  3. From the bound event get the plate reference in the array, the reference should match the triggered plate. If it does then activate the plate and increment. If it fails then reset.
  4. On every activate check if the integer is equal to the last index of the array.
Door BP

Begin Play:

Bound event:

Reset function:


Plates

  • Idealy you want a base class for the include of the pressure plates. Interfaces work too.
  • I find it best to use the door class to manage the state of the plates.

Hope it helps.

2 Likes

Thank you so much! ill have to get back to you if im still having trouble!

I do have one more question, How did you create that dynamic material instance? im currently stuck on that.


Fixed a small error in the plate bp.

Feel free to ask anything.

1 Like


My plates aren’t changing colors as they are pressed, is my coding off a bit?

First make sure the overlap event of the plate is working by adding a print.

Then make sure the dispatcher bind is working by adding another print in the door class.

1 Like

I got the mechanic to work, overlap functions is working great, the door opens when i have the specific sequence activated. but the color remains white on the plate itself.

Ok. That’s the easy part.

  • Does a print in Activate function work?

  • Are you using the same static mesh / material I used? Asking because of the material attribute name.

  • Can you show how you are changing the state of the plate in the door?

image_2024-01-21_144517568





heres all the Screenshots, the one with “active state” appears once i step on a plate. three of them appear when i step on an incorrect plate

The mesh i used for the plate is a cube, no additional material used , just the one that is there by default

If everything else is working then my guess is the material does not have that attribute.

Can you show what material is assigned to the static mesh?

image_2024-01-21_150530623

That material does not have the parameter GlowColor. You need to either create it yourself or assign the cube I used in the example above.

1 Like

AHHH its all working together now! thank you so much for everything, im somewhat new at this, seriously you’ve been a big help

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.