Thank you for nice tutorial :) I share this for people who have had the same problem as me. 1. Connect the white arrow connection between ‘Set Static Mesh’ and ‘Set Start and End’ in Script. 2. If you do not see the spline white control point on the engine screen, press the 'G' to activate game mode. Then you can check the control points, and clicking and dragging will stretch the mesh.
Thank you mister. It's so useful. If I had come across this video earlier, I wouldn't have struggled with creating roads in my Project last year.😅 I will use this technique in my next projects where I know for sure that it will be useful.. Thank you mister❤
Just finished following it. It works perfectly. When it did, I made an audible gasp in the middle of my college class. This has been such a headache for me. Thanks, mate!
Thank you for tutorial! I got some issues with mesh not repeating like other people. Probably bc on 6:42 most of us MISSED put 1 value in ADD function, i miss it few time even with rewatching
Thanks. Couple of quick comments. Your edit cuts are very fast after you have connected nodes. If you just paused for 1 or 2 seconds before jumping to the next cut it would be much easier to follow. Offsetting or using node reroutes would make following the long chain of targets coming of the Add SMC return value easier to read as well. You have them all perfectly lined up so its just one long blue line running behind that top row of nodes. Thanks.
Thank you so much for mentioning that the model should be more high poly! For the last 2 hours I was wondering why my mesh was not following the curve properly when it actually was way too low poly :D.
Ok I'm basically day two in UE5, I attempted this tutorial at 7am and it didn't work. So I went and did another tutorial and it kind of worked but I realized the things I had missed in this tutorial. Also I came back and read the comments here. Making sure white flow is connected is crucial. Holding left alt to move your final spline. And also I didn't hear you say hold control key when dragging mesh or spline from sidebar. Anyways, I'm here to report that on the same evening, I have made the blueprint successfully. I used the lopoly railroad from CG trader and it looks great and even tho I just followed the tutorial I'm very proud of my little looping track.
I might have missed something I cant seem to figure out. Followed the tutorial, got it working except for one thing, the model seems streched and like its repeating way more than it should. I clamped the vector tangents, I've set the X length and connected the due nodes (as far as I can see) but it's still not repeating as it should. Any ideas guys? Im at a loss. Edit: It also seems to be mirroring the mesh, putting 2 walls in parallel instead of one. I must be missing something dang it.
I wanted to make a road but unfortunately the end point of each sector does not rotate, meaning that instead of a smooth turn i am getting no turn at all + snake-like mesh components.
Nice tutorial, i got it working fine but i still have a problem. When i try to move a dot from the spline the engine freeze, and resume my movement after a bunch of second, it make it really hard to use with precision. Any idea why its acting like that ?
So how would you do this but alternate the mesh? Like if you had a road that was dirt and pavement so you could place it and have dirt, then pavement, then dirt again.
spline isnt working at all im not sure what i have missed... the mesh just stays on the original spline point when i drag it into the level but doesnt continue with my spline or other spline points.. maybe you might know my issue? if you can help thatd be awesome great video!
probably part of the math of setting the mesh's location along the spline is going wrong, I would guess that it's just spwaning the new meshes on top of the previous ones without setting them to a new position along the spline. but without seeing your blueprint of course I can't be sure
Hello, When I compile the blueprint and drag it to the scene, I dont have a "default" option(the place where you selected your mesh) in the detail part. can anyone help me?
You may have figured it out already but in the track blueprint click on the Mesh variable and make sure it is se4t to "instance editable". That way you can change the mesh in the scene and it can be different with each new spline
hi, thanks for the video. but I wonder what if I need some overlap? lets say I want to make cliff with this blueprint and I need the cliff go one anothr so that there is no gap and its mixed in between. How do I do that?
my mesh sometimes twists in on itself on the end point.. is there a way to make the last part stretch to fit the spline in the end rather then twist in on itself?
how can i rotate this spline it only lets me on the x axis i need to be able roll... also if you try to make a loop with it it reverses to the other direction. any ideas?
Hi guys I used to have trouble with this because I followed every step but in the end only one mesh was added and I didn't know what was wrong. BUT I FOUND THE SOLUTION!!! I rewatched the video carefully watching all steps and I found that I HADN'T DIVIDED CORRECTLY!!! I wanted my graph to be clean and not crossed, so instead of dividing the Spline Length by X_length, I did it the other way round. I hope this helps if you run into the same problem!! Solution: Spline length / x length
This is amazing. All set up and working great. I have an additional object that i want to follow the same spline. I created in the blueprint... How can I duplicate this or access the spline by another object.
The spline is working great except that I have issues detecting it with raycasts or sphere casts, even though physics collision works without issues. The mesh I'm using has simple collision set up and I set the spline mesh colision as Collison Enabled. With the sphere cast I tried setting it to both simple and complex, tried the Visibility and Camera channel. I tried setting different collision modes on the spline mesh, using a different base mesh but all of this was without luck.
I spent half a day on the issue before asking and I of course found the solution soon after. The collision channel for the mesh doesn't get set, so you need to set it yourself in the construction script using the "Set Collision Profile Name" node and entering the name of the channel you want.
Amazing tutorial! Thank you. I am using this to add track static meshes to a spline loop for a tank track. I can populate the instance static meshes perfectly around the spline loop in an actor, then add that actor twice to my tank bp for the two tank tracks. (That’s a mouthful!) Now I would like to move the static meshes around the spline loop to “animate” the tank tracks when the tank moves…. How would I go about doing this? When I add the instance static mesh to the spline, I also added it to an array of statice meshes…. But that’s as far as I got 😞
Hi man thanks for tutorial. im new to unreal, i want to create my cable and use this technic and add 2 object in first and last point of itm can you please help me? thanks in advance
Thanks. I created a Static Mesh in that blueprint also and spline component, but it doesnt work. I got messages like: *AttachTo: 'Unit Static Mesh' is not static (in blueprint "Unit_BP"), cannot attach 'AddSplineMeshComponent-1' which is static to it. Aborting.* as many times as my for loop works.
Great tutorial! How did you made spline points anchored, I cant make turns for some reason? Got it need to hold ALT. Another problem I run into - cant get collision to work on spline generated meshes. Thing is when I raise my road above other meshes with collision on, I can step (jump) on it, but when my mesh enough low and crossing other objects, my character's feet passing through it, however I see little jump. Feels like theres some tuning needs to be made to feet offset of my character, which is quite weared.
all cute and all, but got a wierd question, why can't i access the spline as a child actor inside a actor itself ( doing a procedural world creation with world blocks ) yet i wanted to replace my 36 fixed actors Bp inside that block with something less memory eating. i was thinking about that exact procedural track but can't seem to move the spline points nor addind new ones :/ ( tried a spline mesh component form the 5.3.2 UE yet no success and if i want that soemthign close to yours i have to extend my meshes manually ( blender ) and do all sort of math deformations for only 1 part wich is dum and unpratical .)
wait im might be just dumb enough... think il need to set straightly splines instead of trying to impliment the 'created actor' inside the world blocks actor . so in term copy pasta this function and script inside each worldblocks xD edit : doing so works out. now i have to set pool objects so the engine doesn't create new blocks but reload ( objects into it, enemies spawners and all ) pre-existing ones and relocating
Great guide mate! The mesh I got was very low-scaled, i merged them in UE and in build settings increased the build scale. So when calculating, mesh will be calculated with its own length or should i multiply it x10 for example? The reason i am askin this when we merge meshes and create a new Static mesh, and set its build scale, does it count as original scale?
This is great thank you. I've watched your video many time but i cannot get the spline points to popuilate. is tehre a hotkey? when i press add nothing happens. Also the track does get bigger but it does not create more points
I'm having a problem. When I move the spline it doesn't update unless I change something in the details panel or undo. Is this a problem with me running UE 5.4? Great tutorial though!
Hi, your tutorial uses a fuction "set forward Axis" which does not seem to be an available function in my project. infact the "spline mesh" drop down that contains this function is missing completely. is there a plugin required that wasn't mentioned? my unreal version is 5.3.2
no this should be in the base unreal engine. I just checked to be sure nothing changed but it's still there in 5.3, i even use it for some assets in my own game, what kind of blueprint are you trying to put it on? it has to be an actor, i dont think you can add these to a component if that's what you're trying to do
@@thegamedevcave Just checked my project and the BP has the Actor parent class. but I have found the problem, basically for whatever reason I don't understand the "Context Sensitive" button on the action search drop down filters out all spline mesh functions.
@@kovacore what did you do to fix this problem? I am also unable to get the "set forward axis".. I can see it when i untick the "Context sensitive" But then i cant get the nodes to connect
I am not aware of any of unreal's modeling tools that does this job. maybe i've overlooked that though, so good to look into. At least compared to generates mesh actors, this method doesn't need to be baked, so it's much easier to set it up and come back to it months later and still have it easily editable. But for the most part, on it's own, I'd say there isn't much use in this over a build in splinemesh deformer if unreal has one, this would mostly come in handy for things like train tracks where you have a script that also moves a train over these rails and both the track and the track follow along the same spline
should be possible but you'll likely have to put all of this into a function with a parameter for which mesh you want it to use instead of directly into your construction script. then you simply put that function in your construction script for it's default mesh and then use that same function in your normal event graph on overlap to set it's new mesh value.
Thanks a lot for the tutorial, i got bonus question Is there a way to animate position of start and end point? so my mesh will move along spline inside my blueprint. Not outside like you made in other video. Thank you! :)
@@alexrybin3798 you might be able to animate some kind of offset varialbe for the meshes, i've never tried if spline meshes can be animated like that. I would assume that also is a problem though since i expect the reason splines can't be animated is that the engine really wants to bake your splinesmesh down to a static mesh. But i've never tested that, so it might work?
probably using a too high poly mesh or your PC might be a bit underpowered for unreal (it's pretty heavy to run). or both. in any case, you'll want to have enough polygons for the mesh to deform but not go overboard and make it a super high detailed mesh
Im getting pretty bad lag too trying to move any spline points. i was able to place a spline with a repeating mesh using a non bp method but using the bp method its super lagy... using a ryzen7 5800 with a 3070 ti. and 32gb of ram i dont feel i should be lagging.
So i found the video thats showed how to repeat the mesh on the spline without a blueprint. using this method i have no lag unlike your method. is there any major diffrences between this method and your blueprint method? this video here you dont really show how to add a mesh on top of this spline and have it move unlike the first few seconds of your video. im confused See the non bp metthod here: ua-cam.com/video/JoCPi-9Op5U/v-deo.html&ab_channel=Axton99 can i use this non bp method to place my spline then animate it? cause this lag its impossible to work with the points.... thanks for the video and help
Thanks. My first attempt at this didn't work so hopefully, this method works better. Lol Also, how many polygons would you say a mesh should have on average to bend smoothly? I just don't want the mesh files to end up larger than they need to be.
hard to say as a general statement , depends on the size and how sharply they will turn , a thin pipe that needs to only have a very weak angle can be rather low poly but wide train tracks that need to make near 90 degree turns, you'll want to have a lot more. Generally i would say if your mesh as about 4/5 loopcuts worth of geometry for every meter of distance it is long (in both directions) you'll probably be fine but it's best to expiriment a bit with it yourself to get a good feel for what you need :)
This is working fine but Unreal is bugging out, You have to set the curve in scene and go back and compile again to see the results. I dont know why that is the case if any one have a solution for this let me know.
Hi, I need your help please. I have done everything as you have done in this video, only difference is since I don't have your Road mesh , so I downloaded another mesh from Megascans called Rocky forest path from the Nordic coastal cliff collections with size 349x121x11. Since it is from Megascans , it is also a high poly & is directed along the X axis as well. However, after doing everything like you in the construction script, once I save and compile and try to drag and drop the BP Actor on my landscape, I get a weird squished up mesh of my forest path. Its so squished up that I can't even select the end so I can ALT and drag it. @dedats and @vehiclesunlimitedreviews in the comment section too are having the same problem , can you help please? Thank you for the video, it was very easy to understand but I am not getting the results you are getting.
@@thegamedevcave In the viewport of the spline , I kept only 2 spline points & changed the distance between them to 349 units so they can comfortably fit the 349 length of my static mesh. That did not work as well.. One thing I noticed is unlike your static mesh, when you drag and drop your BP to your viewport , your spline mesh railway track starting position is one of the ends of the spline itself, but for me, when I drag n drop my BP in my viewport, the starting point of my mesh is NOT the starting point of my spline , the centre of my mesh is the starting point of my spline! I think this is why my mesh is so squished up , my mesh is spawning not from the end but right in the middle of the spline point :s How do I make so that my mesh spawns from the starting point of the spline? Below is the image showing the spawning point of the mesh is right at the centre of the mesh on the first point of the spline. postimg.cc/K3G33Q4J
@@ParikshitBhujbal that image looks like something is getting messed up with setting the end position for the mesh. I have to imagine somewhere in all the math nodes something isn't connected up properly. it looks like your roadmeshlength might not be the right value if i had to guess
@@thegamedevcave Hi thegamedevcave, I really appreciate you giving your time to help me with this, I tried other videos for making a spline road but none off them are using the Get Bonding Box node like you, and most off them are using the spline points to find the Location and Tangents for the start and end pos instead of your method, so I really want your method to work because I think its more detailed and dynamic. I checked the roadmeshlength value like you pointed out earlier and it is working properly, it accurately shows me the length of the various mesh I put in the Road Mesh variable which means that your Bounding Box node is working as intended. I am using the exact same nodes as you in the exact same way , the only difference is that when i expand the Get Bounding box it is now showing me a third node , a Boolean called Return value is valid whereas in your video it only shows two nodes. I tried using other meshes but they all have the same issue, the Mesh wont start at the starting point of the spline, the centre of the Mesh is always the starting point of the spline and this causes the Mesh to get deformed and squished up. The Mesh just seems to superimpose itself at the start point of the spline, which is why I can't even select the start and end points of the static mesh. If you look at the comments section there are 2 more viewers facing the same issue as me :(
@@thegamedevcave Hey its working now as intended , I re wrote the nodes at the get location and tangent part and now its working beautifully! :) And Thank you once again for helping me out , keep up the good work :)
Very helpful but I still have a few questions. First, how do you twist it ? if you want it to make like a curve at some point (in tight curves for example) or do a complete twist and are the collisions ok in that case ? Second, how do you change the mesh mid spline ? Imagine you want this mesh 5 times and then the mesh changes, how does that work ? Third, do I need to create the mesh with their real size ? Like a section of the road will be about 30m width ? I'm afraid resizing it in UE won't be good for the Atlas but modelling 30 to 70m long meshes seems... extreme. I'm supposed to do a kit for next year and I don't really know what I have to model so far because I don't know yet if I have to do a twisted version or not... Well there are other meshes to work on but the road is kind of the most important part and that's where I'm stuck... Thanks in advance if you answer and thanks for that video it helped me already !
you can just make an int variable and in the for each loop add 1 to each each time, then check if it's equal to 5, if it is, add your different mesh to the static mesh component instead of the normal one and set the int back to 0, you can just make a separate static mesh variable that you use. if you want to manually add in different meshes at arbitrary placements, that isn't going to work all that well with this whole system. but if you use the above method, it will add in the different mesh once every 5 components. twisting should just be a matter of rotating the spline point around, just make sure your mesh has enough geometry to bend probably to avoid pinching and don't make the twist too sharp. It shouldn't have any issues regarding collision.
@@thegamedevcave Wow, wasn't expecting a response that quickly ! Awsome, I'll try that. I guess I'll create a first version and see how it goes on its own before trying variations. UE is a totally different world for me I'll give that a try, thank you very much !
@@thegamedevcave it rotates around the z axis yes, but I meant to rotate around x Or y axis. Of course this in the case of a train trails not possible :D but my inquiry is to create a sort of twisted form. Thanks for the reply anyway and for your effort inadvance 🙏
it will compress when there isn't enough space. so if you only have a really short spline with a long mesh, it'll compress, it sometimes also compresses the last little bit, between the last 2 points for the same reason.
I'm a beginner and English is not my first language. It's a bit difficult for me to follow your thoughts or to understand the meaning of each function, so I'd appreciate it if you could organize the logic to achieve this effect and the functions corresponding to each step into a logic diagram.@@thegamedevcave
i haven't tried it but I dont think that'll work, I doubt the sequencer updates construction script, you're better off just making your object from a skeletal mesh and animating that I think.
@@thegamedevcave Thanks for reply. I really need long object following path animation in sequencer wonder UE5 have this feature. if I import from Alembic would be pain in the A XD Thanks anyway
My railway works fine but when there is a turn the spline is not at the center of the railway , couldnt explain it better i can send you an image if you dont understand
My guess is either the length math of the mesh is wrong or you might have to make changes to the mesh where the pivot is located, hope my comment gave you some ideas.
I'm not 100% sure but I am pretty sure it would be a draw call for each segment yeah. Since it can't use instanced static meshes due to them all being deformed in different ways, hence the need for more draw calls.
for a lot of use cases this is also no longer needed. unreal now has built in support for putting things along splines in their modeling mode. which is less of a headache than making it yourself (unless you have a real good reason to do it yourself like making a train track that also has a train cart going over it by following the same spline or something)
hey, instead of being rude out of frustration, asking for help might get you better results. you're likely using a different axis on yoru mesh, or somewhere things are getting multiplied in scale weirdly.
@@camerontraer3136 how does it invert the mesh? upside down? or like inside out? either way it sounds liek something is going wrong with some of the multiplication math to set positions and rotation and such.
Thank you for nice tutorial :) I share this for people who have had the same problem as me.
1. Connect the white arrow connection between ‘Set Static Mesh’ and ‘Set Start and End’ in Script.
2. If you do not see the spline white control point on the engine screen, press the 'G' to activate game mode. Then you can check the control points, and clicking and dragging will stretch the mesh.
Thanks for that! For some reason I completely forgot to connect the last two function nodes
Thank you mister. It's so useful. If I had come across this video earlier, I wouldn't have struggled with creating roads in my Project last year.😅
I will use this technique in my next projects where I know for sure that it will be useful..
Thank you mister❤
Just finished following it. It works perfectly. When it did, I made an audible gasp in the middle of my college class.
This has been such a headache for me. Thanks, mate!
Nice work!
Thank you for tutorial!
I got some issues with mesh not repeating like other people. Probably bc on 6:42 most of us MISSED put 1 value in ADD function, i miss it few time even with rewatching
ty, this work for me
Cheers mate! it's always the little details XD
Thanks. Couple of quick comments. Your edit cuts are very fast after you have connected nodes. If you just paused for 1 or 2 seconds before jumping to the next cut it would be much easier to follow. Offsetting or using node reroutes would make following the long chain of targets coming of the Add SMC return value easier to read as well. You have them all perfectly lined up so its just one long blue line running behind that top row of nodes. Thanks.
Thank you so much for mentioning that the model should be more high poly! For the last 2 hours I was wondering why my mesh was not following the curve properly when it actually was way too low poly :D.
I followed your tutorial from start to finish..I don't know what happened..but my mesh is not multiplying or following around spline..
Same here. I run the project in 5.3, every step the same as in the tutorial, but my mesh stays at the starting point and does not follow the spline :(
@@notcrazy I wasn't able to resolve the issue, so I took a different direction.
yep same here
Check to make sure your diving the spline length by the xlength, and not the other way around
Ok I'm basically day two in UE5, I attempted this tutorial at 7am and it didn't work. So I went and did another tutorial and it kind of worked but I realized the things I had missed in this tutorial. Also I came back and read the comments here. Making sure white flow is connected is crucial. Holding left alt to move your final spline. And also I didn't hear you say hold control key when dragging mesh or spline from sidebar. Anyways, I'm here to report that on the same evening, I have made the blueprint successfully. I used the lopoly railroad from CG trader and it looks great and even tho I just followed the tutorial I'm very proud of my little looping track.
I might have missed something I cant seem to figure out. Followed the tutorial, got it working except for one thing, the model seems streched and like its repeating way more than it should. I clamped the vector tangents, I've set the X length and connected the due nodes (as far as I can see) but it's still not repeating as it should. Any ideas guys? Im at a loss.
Edit: It also seems to be mirroring the mesh, putting 2 walls in parallel instead of one. I must be missing something dang it.
i completely follwed your tutorial but i am not getting the mesh after adding mesh to blueprint in the detail panel
make the variable of your mesh public
I wanted to make a road but unfortunately the end point of each sector does not rotate, meaning that instead of a smooth turn i am getting no turn at all + snake-like mesh components.
after the completion of blue print am not able to see the static mesh option in details panel
My "Get Bounding Box" only has 1 Return Value. Is there a way to fix this?
Nice tutorial, i got it working fine but i still have a problem.
When i try to move a dot from the spline the engine freeze, and resume my movement after a bunch of second, it make it really hard to use with precision. Any idea why its acting like that ?
So how would you do this but alternate the mesh? Like if you had a road that was dirt and pavement so you could place it and have dirt, then pavement, then dirt again.
Man I don’t know if you can save my project but I have a box collision I want it to stretch with the spline how can I achieve that.
spline isnt working at all im not sure what i have missed... the mesh just stays on the original spline point when i drag it into the level but doesnt continue with my spline or other spline points.. maybe you might know my issue? if you can help thatd be awesome great video!
basically the mesh wont repeat, i just get the originale point and mesh and wont spawn any more on the spline lol
probably part of the math of setting the mesh's location along the spline is going wrong, I would guess that it's just spwaning the new meshes on top of the previous ones without setting them to a new position along the spline. but without seeing your blueprint of course I can't be sure
hmmm okay i will check it out and see if i can figure it out thank you tho!
@@thegamedevcave
Any luck? I have the same issue.
I forgot to hook in set start and end into the other notes with the white input output arrows/lines
Hello, When I compile the blueprint and drag it to the scene, I dont have a "default" option(the place where you selected your mesh) in the detail part. can anyone help me?
You may have figured it out already but in the track blueprint click on the Mesh variable and make sure it is se4t to "instance editable". That way you can change the mesh in the scene and it can be different with each new spline
hi, thanks for the video. but I wonder what if I need some overlap? lets say I want to make cliff with this blueprint and I need the cliff go one anothr so that there is no gap and its mixed in between. How do I do that?
Nice! How i can change pivot points spline curve in runtime ?
my mesh sometimes twists in on itself on the end point.. is there a way to make the last part stretch to fit the spline in the end rather then twist in on itself?
How to release instanced meshes and combine them into 1?
Thanks. Is there a way to convert the meshes? I use a scattering plugin 'Dash' but cant apply the scatter objects to the mesh..
On 5.4 Mine works but won't update until I recompile the blueprint every time I move a spline point. ???
how can i rotate this spline it only lets me on the x axis i need to be able roll... also if you try to make a loop with it it reverses to the other direction. any ideas?
how could I add multiple meshes to add variation? like some broken tracks
Hi guys I used to have trouble with this because I followed every step but in the end only one mesh was added and I didn't know what was wrong. BUT I FOUND THE SOLUTION!!! I rewatched the video carefully watching all steps and I found that I HADN'T DIVIDED CORRECTLY!!! I wanted my graph to be clean and not crossed, so instead of dividing the Spline Length by X_length, I did it the other way round. I hope this helps if you run into the same problem!! Solution: Spline length / x length
Thanks for the tutorial mate! Works flawlessly! This deserves way more views.
This is amazing. All set up and working great. I have an additional object that i want to follow the same spline. I created in the blueprint... How can I duplicate this or access the spline by another object.
Hello, thank for the guide, it very cool, but I dont know why my mesh dont duplicates but stay a same place.
The spline is working great except that I have issues detecting it with raycasts or sphere casts, even though physics collision works without issues. The mesh I'm using has simple collision set up and I set the spline mesh colision as Collison Enabled. With the sphere cast I tried setting it to both simple and complex, tried the Visibility and Camera channel. I tried setting different collision modes on the spline mesh, using a different base mesh but all of this was without luck.
I spent half a day on the issue before asking and I of course found the solution soon after. The collision channel for the mesh doesn't get set, so you need to set it yourself in the construction script using the "Set Collision Profile Name" node and entering the name of the channel you want.
im confused, my rail does not stay in the center :\ would you know why this is?
So how do i scroll those mesh along the spline? i want to make a tank tread.
Not working, it only works in viewport mode, but there is no on-stage editor in the editor itself. what needs to be done?
in general, I fixed this problem, I had to delete DefaultRoot and then yes, now it is updated both in the editor and in the view port in Blueprint
Amazing tutorial! Thank you. I am using this to add track static meshes to a spline loop for a tank track. I can populate the instance static meshes perfectly around the spline loop in an actor, then add that actor twice to my tank bp for the two tank tracks. (That’s a mouthful!)
Now I would like to move the static meshes around the spline loop to “animate” the tank tracks when the tank moves…. How would I go about doing this?
When I add the instance static mesh to the spline, I also added it to an array of statice meshes…. But that’s as far as I got 😞
well, at far as moving actors along the spline goes, i do have a video about that too! ua-cam.com/video/I7vg-WXBtXY/v-deo.html
Hi man thanks for tutorial. im new to unreal, i want to create my cable and use this technic and add 2 object in first and last point of itm can you please help me? thanks in advance
Quick Tip: You have to disable Nanite of the mesh you wanna use, otherwise its not gonna bend/deform regardless of how high poly it is.
is it possible to add one more variable to control scale of the instanced mesh?
awesome tutorial very clear thank you for always stating what ur pressing or doing :) gonna use this blueprint to make a railgaurd along my roads
Super simple straight forward clear explanation, love it!
Thanks. I created a Static Mesh in that blueprint also and spline component, but it doesnt work.
I got messages like: *AttachTo: 'Unit Static Mesh' is not static (in blueprint "Unit_BP"), cannot attach 'AddSplineMeshComponent-1' which is static to it. Aborting.*
as many times as my for loop works.
How do I add collision and get rid of gaps? Great tutorial otherwise!
I got rid of gaps by making sure my clamped tangent had its max set to Xlength, but now when I extend my track it distorts pretty heavily.
and i just figured it out, i hadn't connected my multiplied index to the distance for the tangent and location both.
Great tutorial! How did you made spline points anchored, I cant make turns for some reason? Got it need to hold ALT. Another problem I run into - cant get collision to work on spline generated meshes. Thing is when I raise my road above other meshes with collision on, I can step (jump) on it, but when my mesh enough low and crossing other objects, my character's feet passing through it, however I see little jump. Feels like theres some tuning needs to be made to feet offset of my character, which is quite weared.
all cute and all, but got a wierd question, why can't i access the spline as a child actor inside a actor itself ( doing a procedural world creation with world blocks ) yet i wanted to replace my 36 fixed actors Bp inside that block with something less memory eating. i was thinking about that exact procedural track but can't seem to move the spline points nor addind new ones :/ ( tried a spline mesh component form the 5.3.2 UE yet no success and if i want that soemthign close to yours i have to extend my meshes manually ( blender ) and do all sort of math deformations for only 1 part wich is dum and unpratical .)
wait im might be just dumb enough... think il need to set straightly splines instead of trying to impliment the 'created actor' inside the world blocks actor . so in term copy pasta this function and script inside each worldblocks xD
edit : doing so works out. now i have to set pool objects so the engine doesn't create new blocks but reload ( objects into it, enemies spawners and all ) pre-existing ones and relocating
Great guide mate! The mesh I got was very low-scaled, i merged them in UE and in build settings increased the build scale. So when calculating, mesh will be calculated with its own length or should i multiply it x10 for example? The reason i am askin this when we merge meshes and create a new Static mesh, and set its build scale, does it count as original scale?
This is great thank you. I've watched your video many time but i cannot get the spline points to popuilate. is tehre a hotkey? when i press add nothing happens.
Also the track does get bigger but it does not create more points
just hold alt when moving any spline point and it'll create a new one, just like how holding alt when moving an actor makes a copy of it
I'm having a problem. When I move the spline it doesn't update unless I change something in the details panel or undo. Is this a problem with me running UE 5.4? Great tutorial though!
might be because the mobility of the actor is set to static, i remember having some people having an issue with that at some point.
How do you drag out the spline like that? Every time I try it seems to just move the camera instead
You have to click it first instead of dragging
How to add offset between mesh , instead of populating one after another.
Do you know how to modify the speed of a spline?
Hi friend, How can I merge splines in different landscapes?
Hi, your tutorial uses a fuction "set forward Axis" which does not seem to be an available function in my project. infact the "spline mesh" drop down that contains this function is missing completely. is there a plugin required that wasn't mentioned? my unreal version is 5.3.2
no this should be in the base unreal engine. I just checked to be sure nothing changed but it's still there in 5.3, i even use it for some assets in my own game, what kind of blueprint are you trying to put it on? it has to be an actor, i dont think you can add these to a component if that's what you're trying to do
@@thegamedevcave Just checked my project and the BP has the Actor parent class. but I have found the problem, basically for whatever reason I don't understand the "Context Sensitive" button on the action search drop down filters out all spline mesh functions.
@@kovacore what did you do to fix this problem? I am also unable to get the "set forward axis".. I can see it when i untick the "Context sensitive" But then i cant get the nodes to connect
What are advantages of this over using one in modeling tools or top menu in UE ?
I am not aware of any of unreal's modeling tools that does this job. maybe i've overlooked that though, so good to look into.
At least compared to generates mesh actors, this method doesn't need to be baked, so it's much easier to set it up and come back to it months later and still have it easily editable. But for the most part, on it's own, I'd say there isn't much use in this over a build in splinemesh deformer if unreal has one, this would mostly come in handy for things like train tracks where you have a script that also moves a train over these rails and both the track and the track follow along the same spline
@@thegamedevcave Ty and for quick response
hmm、question, is it possible to change mesh on lets say component overlap?
should be possible but you'll likely have to put all of this into a function with a parameter for which mesh you want it to use instead of directly into your construction script. then you simply put that function in your construction script for it's default mesh and then use that same function in your normal event graph on overlap to set it's new mesh value.
Thanks a lot for the tutorial, i got bonus question
Is there a way to animate position of start and end point? so my mesh will move along spline inside my blueprint. Not outside like you made in other video.
Thank you! :)
sadly, splines aren't means to dynamically change at runtime so you can't animate the spline points
@@thegamedevcave thank you, what about meshes inside blueprint? in your example it will be moving railroad itself, but not "train"
@@alexrybin3798 you might be able to animate some kind of offset varialbe for the meshes, i've never tried if spline meshes can be animated like that. I would assume that also is a problem though since i expect the reason splines can't be animated is that the engine really wants to bake your splinesmesh down to a static mesh. But i've never tested that, so it might work?
Is it possible to sculpt it first in blender and add the material and all?
sure , you can do this with any model you like
I am causing too much lag when it is generated and when I see it
probably using a too high poly mesh or your PC might be a bit underpowered for unreal (it's pretty heavy to run). or both.
in any case, you'll want to have enough polygons for the mesh to deform but not go overboard and make it a super high detailed mesh
Im getting pretty bad lag too trying to move any spline points. i was able to place a spline with a repeating mesh using a non bp method but using the bp method its super lagy... using a ryzen7 5800 with a 3070 ti. and 32gb of ram i dont feel i should be lagging.
So i found the video thats showed how to repeat the mesh on the spline without a blueprint. using this method i have no lag unlike your method. is there any major diffrences between this method and your blueprint method? this video here you dont really show how to add a mesh on top of this spline and have it move unlike the first few seconds of your video. im confused See the non bp metthod here: ua-cam.com/video/JoCPi-9Op5U/v-deo.html&ab_channel=Axton99 can i use this non bp method to place my spline then animate it? cause this lag its impossible to work with the points.... thanks for the video and help
Amazing video, and very helpful! NO clue why you dont have more views, you deserve it :)
can ı use it in sequancer?
Thanks. My first attempt at this didn't work so hopefully, this method works better. Lol
Also, how many polygons would you say a mesh should have on average to bend smoothly? I just don't want the mesh files to end up larger than they need to be.
hard to say as a general statement , depends on the size and how sharply they will turn , a thin pipe that needs to only have a very weak angle can be rather low poly but wide train tracks that need to make near 90 degree turns, you'll want to have a lot more.
Generally i would say if your mesh as about 4/5 loopcuts worth of geometry for every meter of distance it is long (in both directions) you'll probably be fine but it's best to expiriment a bit with it yourself to get a good feel for what you need :)
This is working fine but Unreal is bugging out, You have to set the curve in scene and go back and compile again to see the results. I dont know why that is the case if any one have a solution for this let me know.
its hard to select the endpoint
Yeah it takes some getting used to working with splines in unreal
Amazing job. You made my day. Thank you for this useful video
does this work in ue 5.4.2
Thank you very much, works like a clock !
Hi, I need your help please.
I have done everything as you have done in this video, only difference is since I don't have your Road mesh , so I downloaded another mesh from Megascans called Rocky forest path from the Nordic coastal cliff collections with size 349x121x11. Since it is from Megascans , it is also a high poly & is directed along the X axis as well.
However, after doing everything like you in the construction script, once I save and compile and try to drag and drop the BP Actor on my landscape, I get a weird squished up mesh of my forest path.
Its so squished up that I can't even select the end so I can ALT and drag it.
@dedats and @vehiclesunlimitedreviews in the comment section too are having the same problem , can you help please?
Thank you for the video, it was very easy to understand but I am not getting the results you are getting.
did you move to spline point? if your spline is too short it'll squish your mesh since it can't cut off any part of the mesh
@@thegamedevcave In the viewport of the spline , I kept only 2 spline points & changed the distance between them to 349 units so they can comfortably fit the 349 length of my static mesh.
That did not work as well..
One thing I noticed is unlike your static mesh, when you drag and drop your BP to your viewport , your spline mesh railway track starting position is one of the ends of the spline itself, but for me, when I drag n drop my BP in my viewport, the starting point of my mesh is NOT the starting point of my spline , the centre of my mesh is the starting point of my spline!
I think this is why my mesh is so squished up , my mesh is spawning not from the end but right in the middle of the spline point :s
How do I make so that my mesh spawns from the starting point of the spline?
Below is the image showing the spawning point of the mesh is right at the centre of the mesh on the first point of the spline.
postimg.cc/K3G33Q4J
@@ParikshitBhujbal that image looks like something is getting messed up with setting the end position for the mesh. I have to imagine somewhere in all the math nodes something isn't connected up properly. it looks like your roadmeshlength might not be the right value if i had to guess
@@thegamedevcave Hi thegamedevcave, I really appreciate you giving your time to help me with this, I tried other videos for making a spline road but none off them are using the Get Bonding Box node like you, and most off them are using the spline points to find the Location and Tangents for the start and end pos instead of your method, so I really want your method to work because I think its more detailed and dynamic.
I checked the roadmeshlength value like you pointed out earlier and it is working properly, it accurately shows me the length of the various mesh I put in the Road Mesh variable which means that your Bounding Box node is working as intended.
I am using the exact same nodes as you in the exact same way , the only difference is that when i expand the Get Bounding box it is now showing me a third node , a Boolean called Return value is valid whereas in your video it only shows two nodes.
I tried using other meshes but they all have the same issue, the Mesh wont start at the starting point of the spline, the centre of the Mesh is always the starting point of the spline and this causes the Mesh to get deformed and squished up. The Mesh just seems to superimpose itself at the start point of the spline, which is why I can't even select the start and end points of the static mesh.
If you look at the comments section there are 2 more viewers facing the same issue as me :(
@@thegamedevcave Hey its working now as intended , I re wrote the nodes at the get location and tangent part and now its working beautifully! :)
And Thank you once again for helping me out , keep up the good work :)
Very helpful but I still have a few questions. First, how do you twist it ? if you want it to make like a curve at some point (in tight curves for example) or do a complete twist and are the collisions ok in that case ? Second, how do you change the mesh mid spline ? Imagine you want this mesh 5 times and then the mesh changes, how does that work ? Third, do I need to create the mesh with their real size ? Like a section of the road will be about 30m width ? I'm afraid resizing it in UE won't be good for the Atlas but modelling 30 to 70m long meshes seems... extreme. I'm supposed to do a kit for next year and I don't really know what I have to model so far because I don't know yet if I have to do a twisted version or not... Well there are other meshes to work on but the road is kind of the most important part and that's where I'm stuck... Thanks in advance if you answer and thanks for that video it helped me already !
you can just make an int variable and in the for each loop add 1 to each each time, then check if it's equal to 5, if it is, add your different mesh to the static mesh component instead of the normal one and set the int back to 0, you can just make a separate static mesh variable that you use. if you want to manually add in different meshes at arbitrary placements, that isn't going to work all that well with this whole system. but if you use the above method, it will add in the different mesh once every 5 components.
twisting should just be a matter of rotating the spline point around, just make sure your mesh has enough geometry to bend probably to avoid pinching and don't make the twist too sharp. It shouldn't have any issues regarding collision.
@@thegamedevcave Wow, wasn't expecting a response that quickly ! Awsome, I'll try that. I guess I'll create a first version and see how it goes on its own before trying variations. UE is a totally different world for me I'll give that a try, thank you very much !
Amazing video, I just have a Q please
how to add rotation ? I mean in my case, I needed to play with the rotation of the mesh along the spline
this already does rotation too, the mesh will rotate and twist along the spline when you rotate the spline points
@@thegamedevcave it rotates around the z axis yes, but I meant to rotate around x Or y axis. Of course this in the case of a train trails not possible :D but my inquiry is to create a sort of twisted form. Thanks for the reply anyway and for your effort inadvance 🙏
the nodes added around 6:20 do that already, it takes the tangent of the spline at any point (which is 3 dimensional) and applies it to the mesh.
I see, My bad @@thegamedevcave
The x/y rotation doesnt works for me either :/
I followed your tutorial and the rails are compressing very badly in the X-axis direction. My version is 5.3
it will compress when there isn't enough space. so if you only have a really short spline with a long mesh, it'll compress, it sometimes also compresses the last little bit, between the last 2 points for the same reason.
I stretched the Spline length and it didn't work, neither did changing X to Y or to Z.@@thegamedevcave
@@nealcaffrey8890 then you should go back over the blueprint and check for issues, I’m pretty sure it’s not a version issue
I'm a beginner and English is not my first language. It's a bit difficult for me to follow your thoughts or to understand the meaning of each function, so I'd appreciate it if you could organize the logic to achieve this effect and the functions corresponding to each step into a logic diagram.@@thegamedevcave
@@thegamedevcave OK,I'll check my blueprint again,thx
can I animate it in sequencer? I want to make snake animation
i haven't tried it but I dont think that'll work, I doubt the sequencer updates construction script, you're better off just making your object from a skeletal mesh and animating that I think.
@@thegamedevcave Thanks for reply. I really need long object following path animation in sequencer wonder UE5 have this feature. if I import from Alembic would be pain in the A XD
Thanks anyway
My railway works fine but when there is a turn the spline is not at the center of the railway , couldnt explain it better i can send you an image if you dont understand
My guess is either the length math of the mesh is wrong or you might have to make changes to the mesh where the pivot is located, hope my comment gave you some ideas.
After struggling all day with meshes that have Z forward axis, doing all kinds of transformations, it was just Set Forward Axis. 🙂 🙂
you are a hero man
thanks bro, you're the best
I made it,I didn't notice you plus 1 at the end position
what do u mean ?
Thank u reminding me,i didn't see that too~😋
Thank You!
Is it one draw call for each piece?
I'm not 100% sure but I am pretty sure it would be a draw call for each segment yeah. Since it can't use instanced static meshes due to them all being deformed in different ways, hence the need for more draw calls.
i t d i d n ' t w o r k e d
I love you❤
Proper complicated shit
for a lot of use cases this is also no longer needed. unreal now has built in support for putting things along splines in their modeling mode. which is less of a headache than making it yourself (unless you have a real good reason to do it yourself like making a train track that also has a train cart going over it by following the same spline or something)
в руки тебе насрать. у меня ничего не работает
thanks for wasting my time. Doesn't work when i checked the axis, and it's completely inverting my mesh.
hey, instead of being rude out of frustration, asking for help might get you better results. you're likely using a different axis on yoru mesh, or somewhere things are getting multiplied in scale weirdly.
@@thegamedevcave sorry, my bad, got frustrated. I apologize. But I’m completely lost to this. Anything you think I could do?
@@camerontraer3136 how does it invert the mesh? upside down? or like inside out? either way it sounds liek something is going wrong with some of the multiplication math to set positions and rotation and such.
after 100 pause/start im tired of you, very bad guide
Go look up another one then, if you want help don’t be a dick, if you’re gonna be a dick, don’t bother coming here 🤷🏻♂️