Download

Help understanding how to generate stairs on the run?

Hello guys,

I want some help on generating stairs in the level. Like passing some variables like width, height, number of steps etc and they change. Something like the BSP stair brush works. but with a custom mesh. And also the possibility to change the mesh. Here’s an approach I thought of, but don’t know if it would work. I’d like to hear your opinion.
Create a custom mesh that looks like this
_
|_ - part of it, and then stack it via code maybe with for-each loop or something.

The width and height, length variable should change the X and Y and Z component of each stair part.
The number of steps should change the var for the for-each loop to stack the stair parts
And simply exposing the StaticMeshComponent - the stair part, to change the mesh.

I’m almost sure the #2 and #3 would work fine, but not sure what problems i might encounter with #1. Scaling the object might break it’s texture or I don’t know stretch it or something. As well as might make it look deformed. I was thinking if there is another approach for that?

I’ve been thinking maybe morph targets but that would take so much time to make… I’m looking to save time. Because for my levels I want to use a lot of stairs, and instead of making different each time, I’d like to make it user-generated.