I was just wondering if the following is possible to achieve in unreal and if so can anyone direct me to some useful tutorials:
a) i want to create an ordinary spline that can deform a landscape (the same way a landscape spline does)
b)i want to be able to add specific road meshes to the spline that can snap one after the other with the option to either allow or decline the ability to stretch the mesh. So for example i want road segment a, b and c to not stretch but then as it goes around the corner i want to allow section d to stretch.
Hopefully this is possible!
TIA for any help!
The landscape spline system works very similarly. You should be able to copy/paste points into it. And hopefully with the new update they will actually expose the spline component to BP so you can literally use them interchangeably.
As far as stretching goes the short answer is no.
the best thing is to create a seamless road material that covers the mesh. You can use landscape cords and cloud textures to create variations in colors/hue or even normals that are placed randomly on the material.
this way the road can be seamless and natural looking without requiring many more meshes then the spline points decide to use.
On that note, my roads usually use 2 or 3 different materials, center line, side line, and asphalt. The UVs are mapped to the different materials.
additionally I added in a second and third UV that I can get the material to change based on what kind of road I want to utilize for the particular spline section.
Imagine one way street with no lane in between, or a road with a bicycle pathway to the side…
Yes, this is all definitely possible.
a) You can deform landscapes with ordinary splines using the “Editor Apply Spline”](Editor Apply Spline | Unreal Engine Documentation) blueprint node.
b) If by “stretch” you mean to make a mesh curve around a corner, then you can do that with a Spline Mesh Component. Here’s an old but good tutorial series I used to learn how to make a basic road tool using splines and spline meshes. Since then some things have changed. For example, instead of “Get World Location at Distance Along Spline” It’s just “Get Location at Distance Along Spline” with an input option to choose world space or local space. Local space doesn’t have the location doubling up problem mentioned in the tutorial.
Have to say, the editor apply spline is a life saver.
Converting the points from the copy paste from one mode to the other is hell.
Dragging off from the Landscape component you can also try to Add Spline component, and loop through the original spline + add point.
I haven’t done this as I do not have a need to, but someone may.
The landscape spline offers better control then the BP node for apply spline.
You can have a side of the road be less then the other, whereas the Apply Spline only allows to change width / falloff between start and end of the segment.
I will likely have to test that in the next month or so for a different portion of the landscape I’m working on. Coastal roads have no falloff on the rock side…