I’m trying to create a tower crane where I can change the height and with it control how many tower modules would be create, a simple array of static meshes, as a parametric model. Mainly for use inside a Sequence. I create some tests using a blueprint and come to two ways but both have problems. I think the better way would be using a control rig, where I would have better control but I don’t know how.
First I tried to inside the Construction Script add the modules as static meshes, basicaly using a variable with the height as a float wich control the elevation of the top part of the crane and dividing by the module height I create the static meshes in different elevations. Works great but I can’t animated using Construction Script.
Second I tried to make using the Event Graph with Event Tick to generate the modules while running the sequence , when I change the height variable and works on the sequence but outside the Sequence the modules aren’t created.
Can someone help me create a tower crane rig with variable height and tower modules quantity, or what would be the better way to create a array of static meshes wich can be animated and viewed.
Your first method sounds like the right way. What do you mean by “I can’t animated using Construction Script.”? Could you do it on BeginPlay instead and would that help?
For the tower, you could use an Instanced Static Mesh component, and it might be easier to use an integer as a var to control the height.
Then in the function where you update tower layout, use Get Instance Count, and if it’s less than the height integer, add instances at (height variable * the actual height of each segment). If instance count is higher, remove the extra instances.
Do that as step one in a sequence, then on next pin, move the boom to the top of the stack.
Such a function could be called by construction script, or even in-game if players can edit the tower somehow.
Thanks for the answer, I mean that if I change the variable responsible for the crane height inside a Sequence, it wont reflect the crane if I created the nodes inside the Construction Script, I could copy the blueprint from the Construction Script to the Event Graph but then it wont reflect the changes outside the Sequence.
Unless I am mistaken, you could have the function run in the construction script, and you should be able to call that function from the Sequence as well.