I am trying to build a blueprint that makes a repeating wall.
The inputs for the blueprint include the Blueprint Class for the wall segment (a Packed Level Actor), the number of desired segments, and the length of each segment (I will try to auto-calculate the length from the segment later, but for now using a variable is easier).
The idea is that if I give it a wall that is 500 cm long, and say I want 5 segments, and have this blueprint located at 0,0,0 with a rotation of 0,0,0, then it should create these 5 walls:
Wall 1: loc: 0,0,0 - rot: 0,0,0
Wall 2: 500,0,0 - 0,0,0
Wall 3: 1000,0,0 - 0,0,0
Wall 4: 1500,0,0 - 0,0,0
Wall 5: 2000,0,0 - 0,0,0
I have a For loop tracking which wall segment to place. I use Get Actor Location to get the blueprint starting point. And I use Get Actor Rotation to get blueprint rotation.
My question is… how do I efficiently calculate the coordinates of the next wall segment? I’m sure I can brute force it by calling trig functions for all 3 dimensions, but I’m also certain that there MUST be an efficient vector math function that can do this, that is much more CPU efficient, and also results in a cleaner blueprint.