Hi I am hoping to build an array of objects(just multiple duplicates of one object). With the original or master in the center, and with a slider, say 30 or however many objects, move out in x and others in y, equidistant from each other. To make a full grid of said object. Ive mostly only being using Unreal like a traditionally 3D package, to render cinematics and only briefly have dabbled in blueprints here and there. but I have built other setups like this, with layers in After Effects, or with cloners in C4D. Hoping to figure out the best approach in Unreal, and I am assuming blueprints should be able to handle such a request?
Looking for any tips or guidance on where to start. Thanks.
You just build a construction script to make a grid of objects. When you do that, one thing youâll have to consider, is the distance between them, and this becomes a parameter.
To achieve your effect, you can just tweak the parameter.
Awesome, thanks for this info. Also, and maybe I could figure it out when I get in there and try this, but I would also need to keep the original object in the center, so the meshes would spread out from it, above and below, or in positive and negative, I suppose, but the center original/master object would stay where it was. And the array of objects would be children of the center object and all move with it, when animated. But I may be able to figure all that part out possibly. Thanks!
Itâs just a small tweak, Iâll come back a bit laterâŚ
So, to avoid actually trying to figure out where we should put these things. Instead, we do the same as before and then move the whole lot to the right place
Youâll need a scene components ( itâs in the component list )
And we reset the scene to the actor location at the start of every construction
As we make the meshes, we need to attach them to the scene:
Then, when weâve done the loops, we put everything in the right place:
In the end, it looks like this. The rest of the code is the same
This is amazing, thank you ClockworkOcean. I will definitely give this a go. Awesome, thanks again. I will update on my progress when I am able to jump back in.
Ok, started making this, and remember I have very limited blueprint knowledge. Mostly just followed a few tutorials on specific stuff, or editing a couple pre existing blueprints in the past. I have never done or messed with a construction script before, so just bear with me.
So I stumbled around for an hour or so trying to figure out where and how to add the different variables(N, Distance), or what their functions are even called to begin with. I have written code in the past, and occasionally here and there so I knew a bit of what was happening in your picture, and made the assumption they are variables. Luckily I found the variable menu on the left and sussed out how to add them and set them.
Then got stuck here for a good while.
Some of the other functions I didnât know what they were or how to add them as they donât have a name in the picture. Took me awhile to notice the mult âXâ symbol on them, so I found the math functions that way. And then got stuck for a good bit on how to split out out the struct pin(X,Y,Z) on the âAdd Static Mesh Componentâ Thought maybe I was using the wrong function for awhile.
So as you can see Iâm very new to this construction script, but I am digging what it can do, still need to wrap my head around some parts. On that note there is likely something wrong I have done. Mine does not clone objects around the center blueprint. They become offset like in your first post.
As you can see I only need a grid in X and Z, so maybe thatâs why mine isnât fully working as expected? I dont fully understand how the Add Local Offset is working, so I am guessing my issue probably lies there.
How my script currently looks. Any idea what I have done wrong? Really appreciate all the help so far, much further along than I imaged I would be. Thanks
Well, this is coming along great!
Your problem is with the offset. This
was designed to offset in all 3 axis. But youâre only using 2. So you only need to offset in 2
My indexes on the loops also went from 1, yours go from 0. That might mean the offset is calculated correctly. If you want to go from 0, then the offset is
Nice. I actually just figured out after stepping away, but was this same exact change you posted above. I was doing some dishes this morning and was like, oh yeah, I only need to offset the X and Z, and boom fixed. Changing the 1 to 0 figured out last night, just messing with numbers randomly, but your explanation as to why makes sense now.
Thanks Again