Hi all.
I am new to UE4 and I am trying to generate a sequence of rooms but I seem to be having issues achieving this. I have an array that has 3 static meshes (3 different rooms with 3 different ceiling heights). I want a sequence to make a BP that every time I am running the game it randomizes the order of how these rooms appear. If a room is generated once it shouldn’t be generated again. A good scenario for the sequence of these 3 rooms is like the one below.
[ATTACH=JSON]{“data-align”:“none”,“data-size”:“medium”,“data-tempid”:“temp_210119_1608676463134_263”}[/ATTACH] https://forums.unrealengine.com/core/image/gif;base64
I seem to be almost close to the solution but I having an issue with my BP since I am not always generating different rooms as I was expecting according to my BP. BP below:
Hi man,
pay attention to the “set staticmesh1”,
That node is plugged with the “Get” , and that node is plugged with the “Random Integer”.
Now see how you connected the Get to 2 nodes the “Set static mesh 1” and “Remove”
So the Get will be “Fired” two times, and he will ask for a " Random Integer 2 times" !
And the node will give you two different values ! making you set a varialbe and deleete another.!
I suggest you to just take your array of rooms and use the node Shuffle
This will rearrange your array in a random order,
Than you can just loop for each and set the staticmesh0 to room0 … .