How to Set a static mesh actor variable to blueprint generated static mesh

Ok the event graph looks good, now it’s time it seems to check the “mobility” of the components. We want the blueprint itself to be static, no more flying off, and the RootSceneComponent, and the Spline ( you may not have the ability on the spline)

If your construction script has not changed, it looks fine as well, the “typing” is protecting you from doing anything wrong really.

but it “feels” as if the movement is “bubbling” up, to higher level components (but that doesn’t explain why the steps are not moving, as they are supposed to be attached to the spline.

can you show the code where you do the attach?

.

Just a quick one, one thing i did change, was i added set static mesh after the add static mesh, then from the set static mesh i add to the array
Image…

Im not quite sure what you mean by where i attach ?

,

Ok, then I am a tad confused, I would have thought you had another function where you were hooking it all together.

See when you check the box, Manual Attachment, that tells the Blueprint VM, to NOT attach the SMC (Static Mesh Component) to anything (hover your mouse pointer over the Manual Attach check box, and it will explain it), hence you would need to attach those components to “something” i.e. a scenecomponent if you will (your RootSceneComponent), I have just been assuming you were doing that in a later function. Putting the SMC into an array is not attaching it, that’s just keeping the “pointer” (or reference) to the object around so you can get it back later.

So let’s get an attach node in there, where your taking the SMC an explicitly attaching it to the spline, and setting the local location using hte transform you have built, OR, uncheck the manual box.

.

Alright thats my bad, I was following a tutorial Blindly, (i say that as this is my first time using Blueprints, and the engine so im not really sure what im doing.)

So i basically have to create a function, and plug the function into that Attachment Node correct ?

Now im not quite sure what im attaching to.
My thinking is im going to attach the steps to the spline at a given point, so its ON the spline per say.

Now i have no idea how to do this.
Learning is hard, but perseverance is what makes you succeed.

You don’t have to do it in another function, that would probably be over kill. After you set up the static mesh, and add it to the array, then just draw off a pin from the Exec, and do the attach. There’s a node called exactly that, and pull in the Spline variable and wire that to In Parent, then just wire in the just created SMC, into the target (and yes these “pins” could have been named much better, like “Parent”, and “Child being attached”). When this is done, in the hierarchy, you will have

Blueprint is the owning actor of the whole mess
RootSceneComponent is the owning component of everything
Spline will now be the owning Component of all the SM components.

Frankly i’m surprised that you were able to see the stairs at all, without them being attached. Also remember that you can uncheck the Manual Checkbox, and then the Blueprint will do it behind the scenes, BUT, the blueprint will just probably attach them directly to the RootSceneComponent, which in your case would be fine, right up to the point, where you decide you want to move the Spline Component’s location itself from within the blueprint, then all of a sudden the spline will have the new location, and the Stairs, will be right where they were.

.

One other thing about the blueprint editor, most of the time, you will want to have that “context sensative” checkbox, UNCHECKED. When that darn thing is checked, it limits what you can see, in terms of nodes so much, that it becomes almost useless to have it.

So the first thing I do, when going into a blueprint is, Right Click, get the menu, Uncheck that silly box, and get after it.

.

ok you also need a a node to set the local/world location. Remember when the Manual Attach checkbox is checked, for the Add Static Component, it’s supposed to ignore the transform there.

You can use the same transform, just wire it into a node to set the transform for the SMC, before you do the attach.

.

Hay man,

Alright so below is a sreen shot and its all positioned well, but it still flys off, but now its flying off in a diagnol direction, Is there something im missing here ?

So after adding to the array but before the attach, or before the array ?
The set world Location is what im using.

Also can i use the output from the GetLocationAtDistanceAlongSpline Node for the value of New Location in the set world location node?

And the target is the SMC Created correct ?

Alrighty i did that and its still moving the thing as a whole, the indavidual steps are not moving.
Is it now back to the event graph ?

The sequence really doesn’t matter, just do it all before the attach, that is when the current transform will be used to update everytihng (like overlaps, etc), and you don’t want that happening more than you absolutely need

Yes you can use the getloationatdistancealongspline, sure can.

.

Heres an image o f what i have

yes this screen shot looks fine. Now back to the event graph. Be sure and check that the top level scene is set to static mobility. And let’s take a look at the event graph.

.

Hay man,

Alright so i have made sure that the RootSceneComponent is static but its still moving along to the side.
Im not to sure what we can do to improve the event graph.

What is moving along to the side? You cannot see a spline at all in game, as it’s just a mathematical entity, nothing more than that. The visualizer for a spline, is what you see in the editor. Are the stairs moving to the left/right something like that?

Yes, i can see the steps, but they are still at their fixed position but moving together as a whole object to the side.

ok, then the amount and direction to move the steps is not being computed correctly. it’s nothing more than that.

.

after we add relative location, should we not set it to another node ? as it just ends there ?

Alright i need so understanding here quick.

Every frame, I need to get the current position for each step then take that position and and add on a specific value, (i.e, 5) that the step must move by, then do i take that value and multiply it by the speed ? and then set that position to a point along the spline.

IF that logic is right or needs tweaking, what nodes would be used ?