Switch to re-scale actors

Hello there,

I am having some difficulties programming a little puzzle. I have just started, but I am not really good with blueprints, so if you can help me out I’ll be grateful. Here is the thing:

Players has to go up through a staircase which is currently impossible cause the height of each stair. Player needs to reajust the height of every single stair through 2 switches. One switch controls the ‘even stairs’ (2,4,6,8,10) while the other one controls the ‘odd stairs’ (1,3,5,7,9) . Let me go through with a quick draw.

So, player will have to activate the switches till he gets the right combination so as to reach the goal area. For that purpose:

Each switch has 4 positions. When it is pressed for fifth time, the switch’s next position will be the first one again, as a cycle.

Each position has a set of values compound of the height of each odd stairs or even stairs, respectively. For example: first set of values from odd stairs will be (1,3,5,9,7). This numbers represent the height of each odd stair (1,3,5,7,9) in the first position of the switch.

So we can say that each stair has four height values that will change depending on the position of the its switch (even or odd).

Each time that the odd switch is activated, stair1 changes its size in Z to 1, 5, 3 and again 1 (in this order), being the 0 the minimum and 10 the maximum heights. This happens with every stair. I have planned change the values through maths, but it could be also a good idea giving a Z value of 10 to each stair and move them up or down as many units as I need in each case.

As you can see, it is designed, but it is hard to me to put it working with blueprints. I can attach you some of my thoughts in boxes, but it is pretty poor, actually. And actor it is dissapearing each time I get to the trigger with the character.

Any help would be so appreciated. Thank you, guys.

you need to learn INTERFACES:

Then you make interface lets call it “scale stair”

and you add some variable that tells if even or odd stairs need to be scaled. I would do this as 2 integers plus one vector, first integer tells stairs which number to use with modulo function second tells what fraction part need index of stair match to be scaled, third variable should be vector that describes scale.

Then you get all actors with interface, and call their “scale stair” functions in loop

Ps. when doing interfaces (and this bug is still there) do not forget to add return value to interface function or it will never pop in list.

Thank you so much, I ll try as you said. I will share my progress in the future :smiley: