Pressure pad puzzle
Hello, I am working on a boss puzzle where the player needs to stand on three different pressure plates for a set amount of time to do damage to the boss. I am assuming the best way to do this is to set up trigger boxes where the pads are going to be, and write a blueprint for when the player is inside of it for x amount of time the boss takes 1 point of damage, the pressure pad becomes inactive, and a spotlight thats above the pressure pad turns off, and when all three pads are inactive the boss dies. Also I am the 3d modeler for this so im not 100% on doing this, so any screen shoots or explaining in easy terms would be really helpfull
asked May 05 '18 at 08:06 PM in Blueprint Scripting
the picture below shows one method to accomplish this. ill try to run through the basics here. everything here is based on overlaps, so on begin overlap we first make sure that its the player that is overlapping (get player character, equal == nodes) so that we dont run into the issue of other enemies activating the trigger. at the same time we also check to make sure that the trigger actor is active and can be used, this is done with a variable (triggerActive?), later we will set this variable to false when the trigger is no longer active. so if the player is overlapping and the trigger is active then the branch is true and the script moves on to the next part. A similar process is used for on end overlap. when the previous steps are true then we come to the sequence node which activates both outputs almost simultaneously, this opens the gate and activates the delay. the delay is what ensures that the player remains i the trigger for the specified amount of time before the rest of the script can execute. so on entering the trigger the gate opens and if the player exits the trigger then the gate gets closed. if the gates closed then the the enter pin wont work. that was probably confusing and hard to understand but test it out and im sure itll become clearer. the last part is to damage the enemy boss and deactivate the trigger. i used custom events for this part to keep things neat, but you could easily change that. the damage boss event just takes a reference to the boss and applies damage to it. you could get this reference easily by making the variable editable/public and setting it in the details panel once youve placed the actors in the scene. the deactivation is where things are really up to you on implementation but i set the variable to false so the trigger cant be used again and set the lights intensity to zero.
i made this as self contained blueprint actor so that it can be reused in your level. what that means is that you make this actor then you can drag multiple copies into your level, if you want 3 triggers to apply damage then drag in 3 copies of this actor. if you have questions let me know.
answered May 05 '18 at 11:52 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here