I know there are tutorials to do this, but they all require it to function at run-time. Is there a way to control objects on a spline, in the viewport, and in the sequencer? I need to manually control and animate a roller coaster.
I really appreciate your help with this! I’m still rather new to Blueprints, so apologies for the hand holding.
Is there a way to make it follow the path of the spline? It doesn’t appear to be doing that. Also, the mesh is squashed. I’ll try to look into it in the meantime.
Wrap the distribution script in a function and use it the Construction Script - it will run outside PIE, in the editor. You can use the same function run-time, too.
Here’s a bunch of examples:
Image links are currently broken. We may need to wait until the migration is complete and wrinkles are ironed out. But YT if full of hot spline action.
There’s a working project link in the abovementioned thread that demonstrates it.
You’d create a float offset variable, expose it. This variable controls position on the track. If you need to have more than 1 element, each element needs their own offset.
It’s here, a new graph will open after a double click. This part of the graph is executed when the editor creates the object. It will also run when you move or edit the actor in the viewport.
Also, any variables flagged as Instance Editable will be exposed for editing:
You get to control what values sliders permit and set their defaults, too.
[…]what sort of array does this need to be in order to plug into the “ADD”?
It’s about the type. Float is different from a Bool and they’re both very different from a Static Mesh. Think of it: what kind of data can this variable refer to?
I tried that, but I’ve noticed in yours you have a custom event in your construction script. But, there’s no way to add a custom event to the construction script, from what am I seeing. Am I missing something? This is how I’m doing it, based on what I’ve discovered and your recent tutorial.
I think I’m close. I just don’t know where to exactly plug things into.
You do not need the Game Mode bit - this was just to demonstrate variable promotion to get the correct type. Find the Construction Script node in the graph:
Pan around, it’s there and cannot be deleted. You can also press Home on the keyboard and the editor will pan onto it.
Ahh okay! Sorry. Yeah, I got it to work now. Apologies for the million questions, but is there a way to clamp the location of each mesh? I’ve noticed when moving the carts along the spline they bunch up or spread apart. Seems as if they’re going based on the curve.
I’m going to look into it myself, but any assistance would be appreciated.
I also can’t seem to get the cars to animate in sequencer, even after exposing the parameter in the blueprint, even though it’s keyed. Is there something I’m missing?
Ahhhh! of course. Thank you so much for your help. This whole project has been quite the learning curve, but I’ve learned a lot. I sincerely appreciate your help.