Unreal Engine 4 Guide - Spline component - road, pipe, railroad

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey everyone I'm devil and welcome in this short guide about this blind component and display match component this component is really interesting and in my opinion one of the most important in Alvin and Gen 4 you can do a lot of things with this as you can see I'm moving my character on the spline mesh component and it's moving according to the points position and even rotation of these points so across the spline you can spawn everything what you want to just static mesh components but in our case it will be just the spline mesh component which can be bent setting this element is really quick and it takes about five minutes and you can expose some parameters like static mesh and you can replace this with some kind of a railroad or just a road ok so let's get into this okay so as you can see I have prepared some static meshes like rails the road and plan a pipe spline but first thing I would like to do is just creating new blueprint outdoor and it will be just spline a factor okay and inside we just create spline which is really nice component it will be our route and we can add new points and across the spline we just generate new meshes and in our case it will be just fine mesh component so we don't go to construction script get outer spline and a gap number of points we need to get -2 is because we need to generate a meshes but a minus 1 and minus 2 because we our loop is from for loop and from 0 that's why it's minus 2 and for each index we just add mesh and instead of static mesh we just add a mesh spline component right and we can set our static mesh right here and also some points and for right axis but we will just do this setting this right here Seth Nash and we can promote this to variable so I can you just make this visible and controlling outside so yeah it will be our study flash at second thing and just setting our forward axis this is just orientation of our mesh if it's just a facing top facing left right at the suryya so we just use our forward axis so set forward axis and as before unlike before we just promote to variable nia and calling this forward axis it's a simple like that making this visible so right now our actor has two parameters here okay so this is basically almost everything but we need to we can do something more and for each spline we can just attach to our component this is not necessary but it's really nice to use our spline and find every child component later on yeah so we will just use this spline as parent and we can just do something like that and next day think we'll be just setting these values so starting positions starting tangent ending position and ending tangent and we can just set a position and maybe just a start and we have start and a start position start role scale tangent but there is a start and end and we have these values right here this four values iam so yeah how we can set this we need a first point and next one here so we can start from index 0 and just adding one to our indexes iam so we just get a net location add spline point at second a this function will be just a get function at spline point and we need to do the same for index s plus 1 right so I just a maybe not right here I just did mistake just getting our index a from indexes this is first index and second one will be just plus one right so plus one yeah and yeah I can just copy this once again so we have spline point and tangent right location and tangent for plus one year and we need target so I just get my spline and yet I can use a root node so and linking this which everyone so it should be should be fine and we need to link this with our values yeah as parameters okay so this is simple like that and this is a all controlled by these values and set and we can set even one more thing because we have collisions for our spline which is just blocking all but we need to set collisions as well enabled and we can set a query and only yeah and it should be fine I should be able to work on this spline image okay so everything is set so I can just take my spline actor and place on my screen right now and this is right here and I also need to select my static mesh so I need to set my forward axis to that because this is just a facing top yeah the static mesh and I can just put this and I can just taking this point and using alt key just moving this right here and maybe moving this right here moving this right here and adding more points just be using alt key and moving this right here and I can even do something like moving this just right here and one because it's overlapping I can just add point a spline point unit here and just adjusting the scene slightly and adding another spline point right here yeah and something like that yeah so this is this is looking fine so we can try this out using our character I should be able to work on this here and I am so this is working fine as you can see this is really useful feature and useful component especially if we can just use the two of them spline in a mesh component and supply a component and last thing I would like to show is just a using this second type so maybe this road okay maybe just moving this to the top to not arm or maybe this cube it's simpler way just moving this to the top yeah and it's a quite nice right now so we can play once again I'm just moving across and lastly maybe this rails and everything works and it's fine so basically you can just use a train and just moving across this spline and yeah add everything with you what do you want to yeah so this is really nice things to have in your project okay so if you like content like this don't forget to subscribe and like this movie because it helps me a lot to grow this Unreal Engine 4 and programming channel if you have some ideas about future tutorials and guides you can let me know in the comments below or you can just send me an email I will be really happy about that and of course see you next time
Info
Channel: Tefel - Astro Colony
Views: 132,931
Rating: undefined out of 5
Keywords: spline component, spline mesh component, unreal engine 4, road, pipe, railroad, UE4, Tefel, guide, tutorial, how to set splines, bend mesh, curved mesh, points for spawning components, setting tracks, set, easy, quick, tour
Id: kJyWSzfwEk8
Channel Id: undefined
Length: 9min 22sec (562 seconds)
Published: Sat Jul 23 2016
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.