Download

Need help with this

I am trying to make a game where there are a few rows of doors or walls and some of them your are able to go through and some you arn’t. The problem I am having Is with my random door/wall spawner there is a chance for all of the doors/walls to not let the players be able to walk through them so it would be impossible to finish. I was wondering if there was a way to make sure there is a wall that’s able to let the player through in all of the rows. Here is a pic of my random door spawner.

Hopefully I explained it well… if you don’t really understand please tell me what you don’t and I will try and explain it better.

The problem is you’re deciding whether a door can open or not in the door itself, so it has no way of knowing the state of other doors.

Instead of doing that, you can use a door manager. Make a new blueprint actor called “Door Manager” and put this in it (tested & works):

If you only want to get doors in a specific room, you can add a tag to the door actors and use this to get them:
image

Ok I will try this out. Thanks for the help. I will reply to u again if I have any questions

Do u have a pic of all the variables I need?

image
The yellow eye means that it’s “Instance Editable”, which means you can edit it in the level.
“DoorsThatCanOpen” & “DoorIndex” are integers, and “Doors” is an array of Door actors.

Ok thanks I will be trying this as soon as I can. Thanks again

So I was in the middle of trying this and when I got to the very bottom I saw the set (Can Open = true) which I don’t have so what should I do for that?

I think I may know why it wasn’t working… did u make a different blueprint with the Can Open variable? If u did can u show me what u did In it? If u didn’t the I have no clue but hopefully u do :slight_smile:

This is my door blueprint (made it for another thread):


The “CanOpen” variable is a bool that simply stops the door from opening; it’s put in the door blueprint and is initially false. So all doors have the ability to open, but only the doors with “CanOpen” set to true can actually open.


For you, to make it work with your setup, you would do exactly what you do in your first post, but put it in a function and call it from the door manager:

In the door blueprint:
image

In the door manager:

Ok thanks I will try this out :slight_smile:

Thanks for the help. I got it to work

1 Like