I want to randomly generate cubes

You make a blueprint containing the Z scaled cube, and in the construction script:

You can see, when I drag some of them into a level, they do what you want:

350987-flappy-cube.gif

Then you can spawn them along the X axis. Which part are you unclear on?

I am beginner for unreal engine and I am doing some simple project. I made a actor blueprint and add a cube component and resize in z-axis now I want to when I start the game cubes are generate randomly on the x-axis . But it has to be within the two upper and lower limits I have given.

In short, its like flappy bird

350995-flappy.jpg

How to do this. can anyone tell me?

thank you! But I want it to be generated automatically when I play the game. What can I do for this?

Wrap the above with a function. Call it in a loop to generate the pillars on Begin Play or when the player overlaps a collision volume for a more dynamic approach.