I am building a construction script that allows me to place an object then click and drag out a 3d widget and automatically place multiple objects in a row by randomly picking child actor blueprints from an array. my problem is that every time i move the main blue print actor it re-randomizes the entire thing. this is a pain because it breaks my light build. I have attempted to build a trigger that detects if it has randomized x amount of times then prevent it from running again with no luck.
With how construction scripts work, the script will fire at creation, and again whenever the main blueprint is updated (moved, rotated, scaled).
I’d recommend using a function instead of construction script, and calling the function when you want the randomization to happen.
Currently this entire segment is a function I am calling in the construction script. would it work if i created a custom event that allows everything to refresh when i click a button instead? Im not really sure what a custom randomize function would look like in blue print, it doesn’t have any exec notes.
You would attach the randomize function to an existing execution node.
The steps would be:
- Move all logic from construction script to a new function script
- Use an existing exec node (ex. Key ‘Q’ is pressed) to call new function script