Boolean not working after timeline

Hi im new to unreal! I have a problem when opening doors, im making a game and i have made a interact system using interfaces. When I press the e key it checks if there are any interfaces nearby and if there is it sends a signal.

My problem is that i have two doors, and multiple keys/valves in the level when i use the key/valve i want to destroy the used key, because i want the player to find the next key for the next door. Now when i open the first door i can open the second door aswell. i have setup an array that i can choose which door can be opened. I have added the boolean to be unchecked after the timeline but it doesn’t help. I would appreciate any help, seems like it could be a easy fix that i cant wrap my head around. Thx in advance!



Did you mean to set the boolean value after the TL has finished playing?

Currently, it will be set to False every frame for as long as the timeline is playing. Could this be it?

Hi! I tried that aswell with the finish, but it still does interact and do things when i press e at the other door. With that change.

Could the problem be with the array and the chosen doors, or is it something else?

Put a print string after the Event Pickup Valve and see if it is firing for both doors, that door array is weird to me. Also make sure HasRedValve? is default false.

1 Like

What is this?

image

Are you sending the message to all doors here?.. :star_struck:

1 Like

Hi thank you for the responses!

Could there be a better way? I now have a picker tool and can choose which door the valve/key affects. Can be seen in the pic on the right side. Problem is that we have a path that you can choose which way you go first and i only want it to unlock the first door, then the player has to find the key to open the second door, which is behind the first door. If it makes sense :smiley:

I send it to all the actor blueprints that i have chosen, but i only want to use the information once when opening the first door.

1 Like

Yes, you need to only send it to the door you want to open ( I should think… )

If the BP should only open one door, why does it have an array of picker tools? :smiley:

I need it to be able to open both doors, because i dont know which way the player goes first to get the key. If the player goes to the right side and it opens the second door. The player wont be rewarded with the door opening, if that makes sense. The have to run to the left side to get the key for the first door. After that the player can open both doors.

I don’t quite what you mean, but it’s ok, because doors and keys work in a pretty standard way, right? :slight_smile:

You have to separate the key concept from the timeline. The timeline is for opening the door, if it’s unlocked. The key is to unlock a door.

The door BP can have a bool ‘unlocked’, initially this is set to false. When the player uses the correct key, the key is destroyed, and the bool is set to true. Then the door will open, the timeline will play.

Because the player no longer has that key, they can’t open the other door. They have to find the other key.

Does it make sense?

Hi again :slight_smile: This is exactly what I want but don’t know how to implement it. I have no idea how to destroy the key, when the key has been picked up it always can be used in both doors.

1 Like

Where is this code?

Anyway, if you just set ‘has red valve’ to false here

I think it should be ok?

I tried that but for some reason it opens both doors. This is in the door actor blueprint.