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

Hello ,

Probably one of the easiest ways to do this, is to create an array, that holds each of the spline mesh components (this will give the ability to deform the static mesh) that you create, be sure to set the start and end, for the Splmcs. You can “share” (well as all variables except local, the sharing is kind of anticlimatic) the array between the construction and event script, then you will have access to them.

Hope this helps,

.

Hi there Everyone,

I have a spline and im generating steps along that spline.
I need to have those steps to move along the spline. Im using the ITween plugin and i need to add my generated steps from the construction script to the event graph so i can move the steps that have been generated.

Here is my construction script

Here is my Event graph.

Any advice would be great.
Thanks

Hi there ,

Im very new to Unreal engine, Lol this is my first project lol.
So im not quite sure what you mean here.

Once i set the static mesh, then add it to an array ?
Also by deform do you mean, it will stretch the geomatry ? as i need them to stay as a whole step.

yes, the spline mesh can deform (stretch etc) if you wish, if you don’t wish that to happen, just set the start and end of the spline mesh component to be the exact size of the Static mesh your going to attach.

yes, to add the the component, whether it’s spline or static mesh (the way you have it set up), there is only one difference,

  1. Create a variable, and then set it’s type to Spline Mesh Component or Static mesh component.
  2. to the right of where you set the type, will be a little oval, click on that and it will change to a “grid” looking pattern, that indicates that now the variable is an array, and can hold that object type.
  3. Where you create the component, you will drag that pin off to an “Add” node, that the array you created in step two is also hooked up too.
  4. You have just added the newly created component to the array, and will have access to it in the event graph.

There are other blueprint nodes for arrays, such as searching (not recommended really, as it’s just a brute force search), sorting, etc.

Arrays are definitely worth your time and trouble to learn about.

.

,

About to get some sleep, up all night etc.

The one node in your event graph that you will be interested in, is the “Get” node, which takes a numeric index to return the associated component, this will allow you to use a for loop if your going to be moving the components yourself, and the for loop will give you the index value that you need to feed into the get, so that you can then during the “tick” of the event graph, “shift” all the components how ever far you wish, and of course doing the wrapping that your looking for.

Anyway, Good luck, holler if you need more help,

.

Static mesh component - Is what you set the static mesh on. Exactly the way you have it set up in your blueprint. The Static mesh, is what is viewable, the Static mesh component is what is able to exist in the “tree” of objects that eventually leads up to an actor (well actually it’s a Scene Component, but that is attached to the Actor).

A static mesh actor, is really just a convenience for everyone in order to be able to drag and drop a Static mesh into a level, the Editor creates a Static mesh actor, and component behind the scenes, then sets the static mesh on hte component (it’s doing more goodies for you, but that’s the gist of it).

By create the component, I meant the “Add Static Mesh Component” as that is the node that is creating it. and if the SMC needs to be able to move, be sure to set it to be movable, when you click on the Add node, you will in the properties, “static” and “movable”, you will need movable.

.

This is great, So before i Implament i have a few questions,

What is the difference between a Static mesh Component and a static mesh actor ?

point 3, when you say, “creat the component”, Do you mwand, Add static mesh component or set static mesh component ?
Would it work if after the set static mesh, i replace the material with the array correct ?

Hahhaha Dude, Go to bed, You need to sleep lol.

Thanks so much for the explanation, Its good to understand differences and how things work before just implamenting.

so for one, i think im definantly doing something wierd, my break points are not firing and i have placed it on the add component and the loop and still nothing.

So what i have so far, but its not animating or moving.

It’s very good to understand differences, without that, one is wandering around in the forest in the dark, bumping into every tree.

Ok I have never used the debugger in blueprints, because , really does most of the work in the construction script, and the blueprint debugger does not work during the construction script.

Your image is of the even tick of course, and from looking at it, you can

  1. dump the Get node, as you found the for each loop, so just take the array element, and wire it over to the component move node. so we remove a node out of the blueprint (always a good thing)…

I do all the movement of objects in , using a blueprint library (IwBpLib), so I really wont’ be much help, for any kind of “gotcha”, in this little bit of blueprints.

I can say this much though, that node sequence, coming off the event tick, should be firing far more than you actually want. The Tick Event is called every frame, make sure that the blueprint has the tick even enabled. If that’s turned off, well, then nothing is going to happen.

.

is a product that I sell for UE4, nor am I trying to turn answerhub into a selling method. I just mention in reference to what I’ve seen.

To find out about Tick Even, go into the blueprint and click on Class Defaults there should be a section there called Actor Tick. open that up, and it’s the first check box.

I noticed that the video was using the level blueprint ( you don’t have too), and using event begin play (you don’t have to either), just need to figure out, why Event Tick is not being called, put a print statement in that node sequence and see if your output log gets flooded when you fire up the game. Oh yes, if you are not starting the game, the Event Tick is never going to fire, it only fires when the game is actually running, not in the editor.

The links are below my name.

.

Hahaha the bluprint debugging now makes scene lol.

Im not sure what LWSpline is and where can i find it ? Also is there a link so i can check it out, maby a tutorial or example ?

Here is a link of what i was folowing, so im not sure why its not working.

How do i check to see if the bluprint has a tick event ?

Hahaha the bluprint debugging now makes scene lol.

Im not sure what LWSpline is and where can i find it ? Also is there a link so i can check it out, maby a tutorial or example ?

Here is a link of what i was folowing, so im not sure why its not working.

How do i check to see if the bluprint has a tick event ?

Just a quick note.
I got it to work but its bugging out and acting really strange
Its jitery and very jumpt and is not doing a full loop

Alright so now we are getting some where,
Just to answer your previous Comment, i didnt have to add a print node as i noticed that the actors where increasing constantly and never dropping and it started to lag BADDLY.

So it dose a full loop now, but onto another question.
So… I need this to contunuisly loop, but when it reaches the end of the spline it stops, (And yes i do have closed loop checked)

Should i have a tick event check to see when a step reaches the end then continue ? or what should i do there ?

Another quick one, If all the steps are in there from the array, when i press play, they clump together and then move along the spline

take a look at all the parms that the tween node offers you, and I would suggest first, hooking it up to Event Begin Play, so that it’s called one time, instead of probably being called every 20ms or less. See how it reacts then.

.

yes,they will move,because they were set to movable. I thought you were trying to move the escalator “steps” if you will, hence, the setting of movable. So long as they are all being moved, then they should not “clump”

Take a good look at that “tween” node, to make sure it’s doing what you think it is. With the spline closed, what I would be looking for, is to be notified by the tween node in some fashion, such as an event, to tell you when it’s done, Then of course you can fire it off again.

.

This is what hapning.

Could it be that i havew to set their world locations first then move them ?

In truth the spline, likes locations to be location, and if a world location is needed, it will then convert to the world location. So I really don’tthink that is your issue. I can’t actually tell much, of what is going on from a picture. Probably just me being tired.

.

Good grief, the spline likes it’s locations to be LOCAL… sheesh.