How to lock a trigger

Hello,

I want to do something really simple.

I have a door that will not open unless you have a key. I simply want to have the user find the key and the door will open.

In UDK you could lock say the door trigger until you found the key using another trigger. Once you found the key it would unlock the door trigger so the door would open.

Its really as simple as that but I cannot find out exactly what am looking for in any tutorials. Any help would be great.

You could make a bool variable in your character that changes depending on the character having the key. In your Door blueprint you could add a Branch node which requires a true input to open the door.

P.S. I don’t have the engine running at the moment so I don’t know if this is 100% true, but if you are wondering how to get the value of that bool from the character to the Door Blueprint I think you can use the Other Actor output from the trigger event node.

Yes, using the “Other Actor” output from the OnBeginOverlap node of the Trigger will grant access to the Character. You will need to ask it to your specefic CharaterClass/Blueprint. Also, if you are running Version 4.6 of the Engine, you need to make sure that the Bool Variable is set to public. You can do this by clicking on the icon a bit right of the Variable Name in the Variablelist.

With that you will be able to use a branch and execute the door algorithm only if the bool is true. You can set the bool to true when your character found the key.

Thanks for the answer! Is there anyway you could make this blueprint and post a screenshot?

Hi Panzer,

Check out this users post and the video tutorial mentioned at the bottom.

Cheers,

TJ