I want to use spline components and spline mesh components to create paths for my game most videos and blogs use construction script, I used that and it wasn’t good, everytime I compiled the blueprint or move it’s instances the editor would freeze for a minute or so, I want the spline meshes to be instanced into the level not created at runtime so I switched to editor blueprint to do this automatically but I’m stuck again as the add component node gives result and it’s ok until I change something again or close and reopen the editor then the spline meshes are gone
Sounds like you just need to save the uasset after chamges. Theres an editor function for it but i forget the name right now
You’re right that’s what looking for
You can of course do it manually but the node you want is in the editorutilitywidget or maybe other editor tools. You wont find it in a normal blueprint. Im guessing its literally just called saveasset
You’re running into a common Unreal Engine issue with Construction Script vs. Editor Utility/Editor Blueprint component creation. If the goal is to have the spline meshes permanently saved as components in the level rather than regenerated whenever the Blueprint changes, you need to make sure the components are actually serialized into the actor/level, not just preview-generated by the editor.
A possible approach is to create the spline mesh components as native/default subcomponents or use an Editor Utility Blueprint/Editor Utility Widget to generate and save them as actual components. Simply calling Add Component from an editor-time event can show the meshes in the viewport without necessarily making them persistent.
Also, make sure you are not accidentally running the generation only in a construction/preview context. After generating the components, save the level and verify that the spline mesh components appear under the actor in the Components panel/Outliner.
For large numbers of spline meshes, I’d also avoid rebuilding everything whenever the actor moves. Generate them only when the spline actually changes, and delete/rebuild the old components deliberately. That should prevent the editor from freezing every time the Blueprint recompiles.
Yeah, I’m using one right now but I don’t know how to make it work not much experience with Editor Widget or Blueprints.
There are two save asset function which don’t seem to be what I want like if i save the changes they will be applied to the blueprint class which isn’t what im looking for, here is a breakdown :
I want to change the instances inside of the map in a way that the changes persist, just like if I myself have selected the instance from the outliner gone to details panel and added the spline meshes by hand (the changes done by me clicking add component button persists)
If the goal is to have the spline meshes permanently saved as components in the level rather than regenerated whenever the Blueprint changes
yeah thats exactly what Im looking for.
So I have to add components like i normally do like using addcomponent then save the level in the editor blueprint? I will be trying this and give feedback
If you want to lock in the spline meshes so they don’t regenerate every time you move the actor or something, easiest thing to do would be to move all the spline mesh generation logic out of conscript to a new function or event called BakeSplineMesh (or whatever), and tick the Call in Editor option in the details tab for function. This should create a button matching the function name just above variables in the details panel for the actor in the level editor. Only real downside to this is you’d have to click button each time you edit the spline.
I use this trick in a project where I have some expensive overlap checks (and GUID assignments) I don’t want running every frame in editor when I move the actor. Is a bit annoying to have to remember to click a bake button, but you get used to it after a while.
And, obvs, you’ll need to save the level after using new bake for changes to stick, but that’s generally true for editing anything on a bp instance.
Still no luck
I have done this and it’s a very neat thing thanks, the only thing remaining is the saving part which I have the most problem with
As long as you save the level (and/or save all if using world partition) before you close editor, it should be fine.
A slightly different option would be to leave the spline mesh generation in conscript. but put it behind a branch checking if a bAllowSplineUpdate bool var is true, and have a Call in Editor function called ToggleSplineUpdate or something which flips the bool to true or false (or just make bool instance editable). Then after you have the spline setup how you like it, hit the toggle to lock it so it won’t recalculate all the things if you move the actor. Would still need to save level/save all to lock in changes to the bp instance tho.
Thanks for the help, it’s working now I had logical error in blueprint