Move Objects Over a Spline - UE4/UE5 Tutorial

  Рет қаралды 34,950

The Game Dev Cave

The Game Dev Cave

2 жыл бұрын

Making on rails moment systems can be a very useful tool for a wide selection of different games. From an enemy in a shooter game, platformers in a platformer or even basic enemy movement systems like I use in my own tower defense game!
Join the discord for any help you need! : / discord
support the channel and development over on patreon : / thegamingcaves

Пікірлер: 159
@zorakbane
@zorakbane Жыл бұрын
instead of trying to position and rotate your last spline point just select the "Closed Loop" property on the spline component
@thegamedevcave
@thegamedevcave Жыл бұрын
my god this is great! no idea how I overlooked that but I'm pinning this comment so everyone can see!
@MichaelTintiuc
@MichaelTintiuc 9 ай бұрын
To make this work you'd have to change your code from using the last spline point to SplineComponent->GetSplineLength(). Otherwise the current implementation will not take into account that the first point is also the last.
@Zinkquer
@Zinkquer Жыл бұрын
this is like watching a math guide i don't know what i'm doing but it's working
@storeboughtrocketgames2560
@storeboughtrocketgames2560 Жыл бұрын
Pro tip, connect the update execution pin to set actor location, otherwise it just looks weird when the actor sits there and spins. I literally sat there for like 5 minutes trying to understand what I did wrong before I re-watched the video and noticed I didn't have that execution pin set. Great tutorial! Subscribed.
@BeamFreqGames
@BeamFreqGames Жыл бұрын
This is very good. I put the spline inside the drone I was testing, so Actor, and GetActorLocation/Rotation, became Skeletal Mesh, SetWorldLocation/Rotation, and it works as it should. Thank you for a very clean tutorial. It takes a lot of trial and error to make a video game.
@thegamedevcave
@thegamedevcave Жыл бұрын
very glad it was helpful!
@thegamedevcave
@thegamedevcave Жыл бұрын
To anyone who is having trouble. without seeing your blueprint graph I have no idea what is going wrong with your setup. Join the Discord in the video description and drop a screenshot in the "unreal" channel. there I will try to help you troubleshoot
@murnoth
@murnoth Жыл бұрын
This one earned you a sub. Thanks for the coherent content
@thegamedevcave
@thegamedevcave Жыл бұрын
thanks! Hope I can be helpful going forward!
@SalazarElefunk
@SalazarElefunk Жыл бұрын
Great straight to the point tutorial
@thegamedevcave
@thegamedevcave Жыл бұрын
Thanks!!
@alexanderbulkin1490
@alexanderbulkin1490 Жыл бұрын
Thanks, i enjoyed to listen and learn from video! :)
@3BEEZ
@3BEEZ Жыл бұрын
Brilliant Tutorial.
@ITAngel
@ITAngel 11 ай бұрын
Nice great tutorial and I never knew about this so good to know now.
@thegamedevcave
@thegamedevcave 11 ай бұрын
Glad I could help, it's useful stuff!
@mirceam7152
@mirceam7152 5 ай бұрын
Thank you so much for this!
@GameboyCitizen
@GameboyCitizen Жыл бұрын
This is amazing! Thank you subbed!
@thegamedevcave
@thegamedevcave Жыл бұрын
Thanks for the sub!
@rockstar745896
@rockstar745896 Жыл бұрын
thank you for the tutorial!
@user-xj2pf4pl9p
@user-xj2pf4pl9p 7 ай бұрын
super helpful thanks mate
@silvanobaronm.3355
@silvanobaronm.3355 Жыл бұрын
You save my life. Genio, gracias
@manicdistopia2502
@manicdistopia2502 Жыл бұрын
awesome video thanks
@fl260
@fl260 Жыл бұрын
Thank you good sir, I subscribed.
@thegamedevcave
@thegamedevcave Жыл бұрын
Thanks for the sub!
@alexvith
@alexvith Жыл бұрын
Hi, great tutorial! Is it possible to have the animation start from a sequencer trigger? I've been trying to get an object to move along a spline for a cinematic sequence but I can't seem to make it work. UPDATE: I did make it work, but it only works if I hit play, which is still not the best solution. Is there any way to make this technique work or should I look for something else? Thanks.
@thegamedevcave
@thegamedevcave Жыл бұрын
you can start custom events from the sequence so if you hook this system up into a custom event instead of begin play that should do the trick. though i'm not 100% sure you can make objects move over a spline like that in the viewport when the game itself isn't running so you might be better off just animating the position of the object instead of trying to work with this spline system inside a cinematic like that.
@devlogerio
@devlogerio Жыл бұрын
Works like a charm
@thegamedevcave
@thegamedevcave Жыл бұрын
Happy it helped!
@FearsMods
@FearsMods 5 ай бұрын
I noticed you reply to all of your comments, and I am hoping that's still the case haha. I am running into an issue, when I "destroy" the actor that's assigned to the spline path, I get errors. It seems the spline blueprint is trying to grab the destroyed actor that is no longer in play. Is there a way to cancel the timeline if it can't access the actor? Thank you.
@thegamedevcave
@thegamedevcave 5 ай бұрын
use the IsValid node (the macro one, comes up as a question mark icon in the list i believe) it should have 2 outputs, one for when a variable you put into it is valid and one for if it's not valid. only run the code in the timeline update if the object is valid (dont do it before the timeline, if you do it before, it'll only check once and if you destroy the actor mid timeline you're still going to get errors)
@BrujeriasdePapel
@BrujeriasdePapel 4 ай бұрын
Thanks!
@thegamedevcave
@thegamedevcave 4 ай бұрын
Welcome!
@MrAlexramos8485
@MrAlexramos8485 Жыл бұрын
Great tutorial, really thorough. I did run into a slight issue I can't seem to resolve. My actor's rotation is running sideways along the spline is there a way to adjust the rotation of the actor so that the "front" is pointing in the direction of the spline movement? thank you!
@thegamedevcave
@thegamedevcave Жыл бұрын
Your actors mesh local rotation is probably facing the wrong direction, you could try to change it in that actors blueprint, if it happens with ALL your actors, you can just add 90 degrees to the Z rotation with a vector+ vector node
@hiphopshot1050
@hiphopshot1050 Жыл бұрын
@@thegamedevcave ok cool the idea i have is to try to create a 3D text with a holographic material rotating around a building.
@OmmegaTang
@OmmegaTang 8 ай бұрын
Merci mon reuf je t'aimes
@flathmann
@flathmann 2 ай бұрын
Amazing, thank you! I still got a question; How can I change the speed over time? At the beginning I want to make my object move kind of slow, while I want it to move pretty fast in during the end.
@flathmann
@flathmann 2 ай бұрын
Nevermind, I found out you can just adjust the curve in the "timeline" node, which makes it pretty accurate
@antonio_Env
@antonio_Env Жыл бұрын
Nice tutorial thanks, I'm subscribe! One question, if i want to have more than one object like a train with some wagon's there is a way using these method?
@thegamedevcave
@thegamedevcave Жыл бұрын
you'd need to modify things a little, if you use an array instead of a single variable, you can set the position along the spline in a for each loop with a certain offset between every index of the loop, that will effectively create a train-like system.
@antonio_Env
@antonio_Env Жыл бұрын
@@thegamedevcave Thank's i will follow that tip.
@ereaUA
@ereaUA 5 ай бұрын
thank you for the tutorial if my actor has animations, etc (tank from vigilante content), is it possible to make it act like it is driving realistically by this spline?
@thegamedevcave
@thegamedevcave 5 ай бұрын
sure your actor can do anything it usually would, including animations while it's moving along the spline
@subhamsharma8290
@subhamsharma8290 Жыл бұрын
Thanks for the tutorial. How can I pause the movement with a Keybind during gameplay and also resume ?
@thegamedevcave
@thegamedevcave Жыл бұрын
to start and stop you can simply add a bool variable and use a branch to only do all this when that bool is true, then setting the bool to true or false depending on your input , or whatever else you want will make it start and stop moving
@lorenehue6244
@lorenehue6244 4 ай бұрын
Hi, if you want have a Timeline loop, you can use the node "Set Looping".
@thegamedevcave
@thegamedevcave 4 ай бұрын
that's a much better way than what I do here, thanks for pointing it out!! xd
@mohamedabelaziz6239
@mohamedabelaziz6239 Жыл бұрын
Thanks for the tutorial. How can I add more than one object to spline and they have different starting points ? I want to make esclator with that
@thegamedevcave
@thegamedevcave Жыл бұрын
I made an updated tutorial that allows for multiple actors on a spline with an offset between each one recently you can check that out here : kzbin.info/www/bejne/f2jZmGCNjaenjrs
@behemoth775
@behemoth775 Жыл бұрын
Hello, good video. But I have a problem, I followed all the steps but once I place an actor into the spline line it moves the way the path was drawn but outside the actual path. Did I do something wrong with the actor location? I don't really know how to fix it.
@thegamedevcave
@thegamedevcave Жыл бұрын
it's most likely because the pivot point of your mesh is in a weird place. you can test that by just putting the mesh in a level and trying to rotate it. does it rotate around a weird place instead of around itself? if so , that's the issue. I dont know where you got your mesh from of course but in blender you can change it around in a couple of different ways.
@nicolasdesola3332
@nicolasdesola3332 Жыл бұрын
Thanks for the tutorial. How could I add more actors to follow the same spline? All starting with different delay, but visible at the same time? Thanks.
@thegamedevcave
@thegamedevcave Жыл бұрын
to get that working you'd need to modify a fair few parts of this. changing the actor variable to an array, adding a float variable for the distance between every actor and then use a for each loop to move all the actors in the array around. there's probably a bit more to it but that's the basic idea to make it work with more actors :)
@DavidConstance
@DavidConstance Жыл бұрын
@@thegamedevcave would love to see this in blueprints. attempting a dark ride and would love all the "doombuggies" to be evenly spaced and moving along the same path
@ksenja.
@ksenja. Жыл бұрын
Thanks for the tutorial! It works like a piece of cake :3 And I was wondering why setting timeline length doesnt affect speed of moving. Turned out I didn't connect Event Play with Set Play Rate nodes. Debugging is a thing
@thegamedevcave
@thegamedevcave Жыл бұрын
it's easy to overlook simple things! glad you figured it out :)
@GuyChan3
@GuyChan3 6 ай бұрын
Is it possible to also have the spline move? For example, the spline slowly moves downward while the object follows the spline.
@thegamedevcave
@thegamedevcave 6 ай бұрын
Should be able to yeah, i haven't tested it out but in theory you should be able to animate it in the sequencer and have it still work. it might do some weird things the placement though since animating it like that also changes the length
@rudy552
@rudy552 Жыл бұрын
I redid the tutorial but it doesn't work when I do play and on my time line I have (time line paused @ 0.00s 0.0%)
@vikbricks5894
@vikbricks5894 Жыл бұрын
Great video. Can this also be used to move trains along the track?
@thegamedevcave
@thegamedevcave Жыл бұрын
That’s exactly the kind of thing this is useful for!! :)
@vmunozbe
@vmunozbe Жыл бұрын
@@thegamedevcave tnx for the video. I´m trying to do exactly the same but for a train. How I add more wagons? any help??
@thegamedevcave
@thegamedevcave Жыл бұрын
@@vmunozbe there are many ways to do something like that. the most straightforward way is to add some sort of offset and have each cart use a larger offset. you could make a more robust system for that but that would be a whole tutorial on itself
@mrgreatjob
@mrgreatjob Жыл бұрын
Hello thanks for making this was looking for a updated tut on this and got my camera on there, However the big thing I can not figure out having been researching and experimenting all day, is how to have the object moving along the spline actually generate a overlap event? I have tried creating different triggers, objects/actor , making sure all or set to (overlap All) the trigger object and the object on (or you could say the component that is set to move along the spline.) But it will not trigger tried simulating and seeing if there is break, nothing continues running I just don't know. I even tried changing the component there to just a mesh, collision sphere, still no overlap event is triggered. If you have any suggestions I would be thankful. I am using a (Play animation function) that seems to work fine if I use a event to trigger, like onbegin play or something.
@thegamedevcave
@thegamedevcave Жыл бұрын
that's a good question. are you moving a component over a spline with both in the same blueprint? if so, it might be the case that the component wouldn't generate overlap events if the actor isn't moving or something (that shouldn't be the case but that's the best I can come up with without knowing al the ins and outs of the project of course). if that's the case, using a system like i do in this video where the object moving over the spline isn't just a component but a whole separate actor, might fix the issue. otherwise i'm not sure what the issue could be. for debugging purposes it's always a good idea to see if events trigger by putting in a print string before/instead of the actual node youre trying to use, as that way it's very easy to see if the event triggered, because if it does you know at least that part works and can then focus on finding the problem in a slightly narrower search. (though, by the sounds of it, it DOES sound like the event is just not triggering in this case indeed, still, always good to double check that)
@mrgreatjob
@mrgreatjob Жыл бұрын
@@thegamedevcave I will be redoing exactly as you did tonight when I get off work and experimenting more. Thanks for the response. If successful will leave update.
@mrgreatjob
@mrgreatjob Жыл бұрын
Oh and the project is just trying to do fly through and have animations trigger when the object passes through that section. Pretty much like those old hunted house rides I guess? if you want to see look here but may want to mute the audio. "avantegarde" www.twitch.tv/videos/1520859936
@mrgreatjob
@mrgreatjob Жыл бұрын
@@thegamedevcave Your pathing worked perfectly of course, the overlap issue I had turned out I was able to resolve by making the object that will be attached to spline path a Actor and giving it separate collision component that will deal with that interaction.
@thegamedevcave
@thegamedevcave Жыл бұрын
@@mrgreatjob im glad you were able to figure it out!!
@illimitable
@illimitable Жыл бұрын
anyone know how to animate spline element count in the level sequencer?? theres no add keyframe button next to it and the splineelementcount is nowhere to be found in the sequence editor
@thegamedevcave
@thegamedevcave Жыл бұрын
I'm not sure that'd be possible. you could potentially try to make an event in the blueprint that adds one and calling that through the sequencer instead.
@DavidConstance
@DavidConstance Жыл бұрын
How do you set another object to follow the first? Or a complete circle of evenly spaced couches? (thinking the track of Disney's Haunted Mansion)
@thegamedevcave
@thegamedevcave Жыл бұрын
i've been getting this question a lot lately, it's a bit more complicated to make that work so i'llt ry to make a followup tutorial when i can!! it'll take a little while most likely though, for now, in your event tick do all that you see in this tutorial in a for each loop instead with an object array instead of variable as it's input, at the nodes where you find position along spline at a certain length, add an offset value to the spline length there . multiplied my the array index(+1) , also check if that results in a number that's longer than the spline length, if so : subtract the spline length from this number so it loops properly. i know it's a bit hard to follow along with text, a followup video will come but not for a little while
@DavidConstance
@DavidConstance Жыл бұрын
@@thegamedevcave I think I found a solution. Could I message it to you somehow?
@thegamedevcave
@thegamedevcave Жыл бұрын
i'm glad you managed to make it work. you're always free to join the discord server linked below in the description to share your findings :)
@andromenosan5622
@andromenosan5622 Жыл бұрын
Good tutorial! But can you help to add deformation of the model while moving along the spline?
@thegamedevcave
@thegamedevcave Жыл бұрын
i think using a spline mesh instead of a static mesh should allow for that. i'm not super sure how exactly that works right at this moment though, it's been a while since ive done that
@andromenosan5622
@andromenosan5622 Жыл бұрын
@@thegamedevcave Thanks! I'll try this)
@armannasr3681
@armannasr3681 6 ай бұрын
I have a question about this method. If you don't close loop the spline, will the actor respawn at the starting point of the spline after reaching the end point of the spline? or will the whole thing not work
@thegamedevcave
@thegamedevcave 6 ай бұрын
yup you got it right! if you dont close the spline it will just travel to the end and then teleport back to the start! (important to note that it doesn't respawn really, it just teleports so it's still the same instance, not a new one. for the most part that wont matter but if you're doing something with an actor that has ammo or something, keep that in mind)
@armannasr3681
@armannasr3681 6 ай бұрын
@@thegamedevcave Great, I tried this and it worked perfectly. My only other question is that, this works in Play mode, but not in realtime mode when editing, is it possible to make it move in realtime mode as well? similar to clouds and trees and stuff. my end goal is to create sequence animation from this moving object.
@thegamedevcave
@thegamedevcave 6 ай бұрын
@@armannasr3681 no, because this works on tick, it only runs during actual gameplay, not just in the viewport, moving trees and clouds are shader effects, which is why they work outside play mode in the viewport too. you can however put this blueprint into the sequencer and instead of using the math in event tick to set it's position, simply animate the position via exposed variable in the sequencer, that might take a few changes to the blueprint though.
@armannasr3681
@armannasr3681 6 ай бұрын
@@thegamedevcave Thanks for response. I have done this with attaching actor to camera rig in the sequencer, but your method is much easier to do for multiple objects. Do you mind elaborating on how to animate the position with variable in sequencer? Thanks In advance.
@manicdistopia2502
@manicdistopia2502 Жыл бұрын
what if you wanted it to move without hitting play- sort of like how fire works from the stater particle pack
@thegamedevcave
@thegamedevcave Жыл бұрын
I dont think you'll be able to move objects around like that before beginplay
@ZarrosUE5
@ZarrosUE5 Ай бұрын
Is it possible to make it the other way around? Making a spline follow the object?
@thegamedevcave
@thegamedevcave Ай бұрын
i'm not sure what you're looking for with that. you want to generate spline points on the same location as a mesh? or do you want to make a spline that follows the shape of a mesh? because the latter is one of those things that sounds pretty easy to do for a human but telling a computer how to do it would be a massive pain and probably not great for performance if youre doing it in real time.
@gumbahasselhoff
@gumbahasselhoff 9 ай бұрын
Thank you, very helpful tutorial. Is it possible to make an actor move at a fixed speed regardless of spline lenght?
@thegamedevcave
@thegamedevcave 9 ай бұрын
you'll have to change a fair few things around to the point where it's a whole different setup. in short what you'd do is have you speed varaible * deltatime added to a float every tick. then use that float to find the new position along spline. then check if the float isn't larger than the spline length. if it is, reset it to 0. taht way they'll move based on speed instead of distance.
@gumbahasselhoff
@gumbahasselhoff 9 ай бұрын
@@thegamedevcave Thanks a lot for the fast answer. I'm not sure if I can do this with my limited knowledge, though.
@gumbahasselhoff
@gumbahasselhoff 9 ай бұрын
@@thegamedevcave Actually I think I solved it! I substituted the "1,0/Timeline Lenght" Part with a "Speed Variable/Get Spline Lenght" and in a few tests it always does what it is supposed to.
@borrowedtruths6955
@borrowedtruths6955 Жыл бұрын
I have a train locomotive following a train track spline, I then added another train car to the same track spline, both are BP's, but the second train car starts at the exact same place as the first one, the locomotive. Obviously, I need the second car to be connected to the back of the locomotive and follow it around the track, which I simply cannot figure out how to do. Any help or suggestions? Thanks in advance.
@thegamedevcave
@thegamedevcave Жыл бұрын
you'll want to use an array instead of a single variable , then go through a for each loop with that array and use the index to multiply an offset value. it's a rather common question and bothersome to explain over just text so I intend to make a followup tutorial on just this topic sometimes the next couple of weeks.
@borrowedtruths6955
@borrowedtruths6955 Жыл бұрын
@@thegamedevcave Thanks, I really appreciate it. You just earned a new subscriber.
@thegamedevcave
@thegamedevcave Жыл бұрын
@@borrowedtruths6955 if you need help faster than that feel free to join the discord server and when i'm around I'm happy to help you (especially with blueprint stuff, it's easier if you can send back and forth screenshots ;) )
@borrowedtruths6955
@borrowedtruths6955 Жыл бұрын
@@thegamedevcave Can't seem to get into discord for some reason. I tried to reply to your email, but it said the address was not there. When you have the time, I could really use an image of the needed blueprint to make this work. Thanks again for your time.
@thegamedevcave
@thegamedevcave Жыл бұрын
@@borrowedtruths6955 i'm not sure what Email that would be? strange that you can't get into the discord though. i'm not sure how to help you with screenshots otherwise...
@edenscott3200
@edenscott3200 Жыл бұрын
My actor does not move at all, checked multiple times if my blueprint is the same, maybe you can not choose "anything" as an actor at the end?
@thegamedevcave
@thegamedevcave Жыл бұрын
any object in the world is an actor so as long as your object variable is an actor variable, that can't be the issue. if the actor isn't moving when you run the game (it wont move when the game is not playing) and you're 100% sure the blueprints match maybe the speed variable is set to 0?
@stevecavanagh8033
@stevecavanagh8033 Жыл бұрын
I learned a lot, thanks. Next step: to find how to make the player character go along a spline. If I choose that actor with this it gets really unhappy.
@MECLOCO
@MECLOCO Жыл бұрын
Did u find how to do it? Im traying the same but with not success, I change the Actor variable to get the pawn, it snpme into the start of the spine but then it doesnt move :(
@stevecavanagh8033
@stevecavanagh8033 Жыл бұрын
@@MECLOCO Yeah I got that too. Haven't got back to it since then :(
@prod.tlz_
@prod.tlz_ Жыл бұрын
In 1:22 you skip the node you type. I cant find this one. Can you say wich one it is?
@thegamedevcave
@thegamedevcave Жыл бұрын
that's the custom event I just made before that so what that node is called depends on what you call your custom event
@plasid2
@plasid2 2 жыл бұрын
Yestarday I see tutorial about paint on skeleton mesh using render target, you thing its possible the same thing on spline mesh?
@thegamedevcave
@thegamedevcave 2 жыл бұрын
I am not sure but I assume it should be!
@plasid2
@plasid2 2 жыл бұрын
But how take UV texture from all spline and save it to square 2048x2048? Any idea maybe you make tutorial for this
@thegamedevcave
@thegamedevcave 2 жыл бұрын
I will have to look into it, I plan on making a followup to this video soon where I add train tracks to this system, so maybe that will be helpful for what you need :)
@aethylwulfeiii6502
@aethylwulfeiii6502 Жыл бұрын
Is anyone else having the problem where their actor is sperging out in one place? I have tried adjusting the instance editable variables to speed up or slow down the animations but this does nothing?
@thegamedevcave
@thegamedevcave Жыл бұрын
I'm not sure what would cause that problem. feel free to join the discord server linked below the video and send some screenshots of how you have things setup, maybe I can spot the issue that way.
@henrycooper8486
@henrycooper8486 Жыл бұрын
Great tutorial thanks a lot for this! :) Would it be possible to have random objects move along the same spline? If yes how would you do it? Cheers :)
@thegamedevcave
@thegamedevcave Жыл бұрын
there is a couple of ways you could do this, you could make an array and at begin play pick a random entry from the array to set as the actor to move over the spline. that way you can just add 10-20-30, etc different actors it can choose from. or you could use "get all actors of class" at begin play to make that array for you so it automatically picks one actor of a certain type at random (in the same way as i listed above, just pick a random index out of that array).
@henrycooper8486
@henrycooper8486 Жыл бұрын
Amazing thanks a lot! :)
@henrycooper8486
@henrycooper8486 Жыл бұрын
Do you know of any tutorial that shows how to do that? I'm a complete noob and I wouldn't know how to do it, but I would be able to follow along :) Thanks :)
@thegamedevcave
@thegamedevcave Жыл бұрын
@@henrycooper8486 i'm not sure but i'll try to make a short tutorial showing it later this week!
@henrycooper8486
@henrycooper8486 Жыл бұрын
You are amazing thank you so much for this! It is greatly appreciated! :)
@tarekwayne9193
@tarekwayne9193 9 ай бұрын
Do you think it is possible to interpolate physics (without spline) movement with spline movement at runtime? I hope I worded that clearly, thx in advance and for video!
@thegamedevcave
@thegamedevcave 9 ай бұрын
probably not to be honest. the whole idea here is you're setting the position directly every frame instead of letting physics move it around. combining the 2 usually doesn't really go very well together. you'd have to program your own pseudo physics moment.
@tarekwayne9193
@tarekwayne9193 9 ай бұрын
@@thegamedevcave thx for your swift response! Yh, the idea isn't very logical/practical!
@thegamedevcave
@thegamedevcave 9 ай бұрын
@@tarekwayne9193 something else i touvght of that might help you depending on your usecasse is only setting the X and Y positions and setting the Z position equal to GetActorLocation.Z . that way it won't get stuck to the spline in the up and down direction, so that would allow for gravity at least, but it will still follow the path in the 2 horizontal directions.
@tarekwayne9193
@tarekwayne9193 9 ай бұрын
@@thegamedevcave I had something like that in mind also! I also wanted to try out the exact opposite, with the Z axis, precisely to keep the car glued to the track! Maybe turning the gravity off?
@thegamedevcave
@thegamedevcave 9 ай бұрын
@@tarekwayne9193 I would say you for sure gotta turn the gravity off yeah. I'm not 100% sure on the math, i'd have to play around with it but what I think i'd do is whenever your player collides with a car, have the car check if it's being hit from the left or the right, and add or subtract to a float value. then use that float to add a horizontal offset to the left/ right from the spline. You probably could do that with getting the position along spline in local, then adding that float value to either the X or the Y value of that , and then converting that to global position to set your car to that. Otherwise you'll have to mess around with calculating it based on the spline's tangents and adding the offset to that perpendicular to the tangent (which is where I start to be unsure of how I would ACTUALLY implement that... but I think the calculating things in local space first would probably be possible and much easier anyway)
@lordkanesoulreaver
@lordkanesoulreaver Жыл бұрын
go to were loop node is at and it dosent exist in my engon layout sadly for 5.1
@thegamedevcave
@thegamedevcave Жыл бұрын
the for loop still exists in unreal 5.1, it's one of the most basic functions of almost any programming language. try to check if you're following along with the tutorial properly or if you maybe missed a step somewhere. it's likely you're trying to add the loop in your construction script instead of the event graph. that is indeed not possible
@_MaxSky
@_MaxSky 9 ай бұрын
why does the object jerk up and down when moving along a straight spline?
@thegamedevcave
@thegamedevcave 9 ай бұрын
you probably have gravity enabled in the physyics settings
@_MaxSky
@_MaxSky 9 ай бұрын
​@@thegamedevcave Thanks ... I had "Simulate Physics" enabled on actor
@vallebreno
@vallebreno Жыл бұрын
There is a way to make the object to rotate randomly?
@thegamedevcave
@thegamedevcave Жыл бұрын
sure, instead of setting the rotation to the spline tangents you just replace that with another bit of script that sets a rotation at random at begin play and it'll have a random rotation. if you want it to move it's rotation randomly, that's a little more complex though. .
@vallebreno
@vallebreno Жыл бұрын
@@thegamedevcave thanks for the reply
@hiphopshot1050
@hiphopshot1050 Жыл бұрын
How would you apply this to 3D text 🤔🙏✌️
@thegamedevcave
@thegamedevcave Жыл бұрын
your 2D text should function the same as any actor I think so this should work without any major modifications to the script.
@hiphopshot1050
@hiphopshot1050 Жыл бұрын
@@thegamedevcave ok cool thank you because im trying to create 3D text with holographic material rotating around a building using your spline Blueprint. So i like to alos thank you for that
@BrujeriasdePapel
@BrujeriasdePapel 4 ай бұрын
Thanks a lot. but my character move so quick
@thegamedevcave
@thegamedevcave 4 ай бұрын
make sure you set the variable for your timeline length (the float value) to a good number
@gergo01
@gergo01 Жыл бұрын
Doesn't works for me, at best moves to the first point. Yes, I did the Number of Spline Points - 1. I'm using the latest Unreal Engine 5.1
@thegamedevcave
@thegamedevcave Жыл бұрын
well the issue will be somewhere else in the blueprint graph then. without seeing it, it's pretty hard to tell where the mistake is though. feel free to drop a screenshot in the discord server and i'll try to have a look at it if you haven''t found a fix yet.
@gergo01
@gergo01 Жыл бұрын
@@thegamedevcave I found it ... When setting up the Timeline, I'm sure I set points 0,0 and 1,1 - however checking back didn't saved exactly these 2 points, had to fix it again. Can't comprehend how it could happen this, for UE4 & UE5 I recreated these scripts and in all cases wasn't the 0,0 - 1,1 point pairs in the Timeline. Worth to keep in mind this thing with timelines ... might not save what they are given initially.
@TheHumanAnonymous
@TheHumanAnonymous Жыл бұрын
all of this just to move a character along a spline??? Idk how anyone uses Unreal, it takes like 4 clicks in C4D to achieve the same exact thing. So unintuitive it hurts
@TheHumanAnonymous
@TheHumanAnonymous Жыл бұрын
Nothing against the tutorial, just can't believe how over complicated it is to achieve such a simple task
@thegamedevcave
@thegamedevcave Жыл бұрын
I mean unreal is a game engine, that comes with way different expectations compared to 3D modeling or animation software. the whole idea is that any parameter in this can be influenced during runtime, where is in animation you're very carefully creating the 1 output you're looking for. simple example : let's say this is part of a boss fight where the boss is surrounded by turrets on a rail track and the turrets start to move faster as the boss loses HP to make the fight increase in difficulty. So yeah, it seems over complicated and in the end, you could probably get a pretty similar result with just throwing 2 keyframes onto a timeline and calling it a day (still a couple more clicks compared to C4D i'm guessing though) but it's a hard comparison to make.
@TheHumanAnonymous
@TheHumanAnonymous Жыл бұрын
@@thegamedevcave Yeah very true, I can understand that. Either way great tutorial and thanks for the help, just been a tough transition to another 3D program lol
@TheHumanAnonymous
@TheHumanAnonymous Жыл бұрын
@@thegamedevcave Is there an easy way to add banking/rotation to the character on the spline animation btw?
@thegamedevcave
@thegamedevcave Жыл бұрын
@@TheHumanAnonymous i totally get that, moving from blender into unreal was super overwhelming to me too. i'm not sure how deep in the learning process you are at this point but i also have a 6 part series going over some of the basics that might be helpful. kzbin.info/aero/PLoReGgpfex3x1Tmkru1QyTB0pXiWASj5M as for rotation, the simplest way would probably be to just add a vector3 value to your characters rotation at the very end of the event graph , that way you can add X,Y,Z rotation to your actor after it's been lined up with the spline
@orenders
@orenders 3 ай бұрын
extremally bad guide
@thegamedevcave
@thegamedevcave 3 ай бұрын
Hey, maybe instead of just being rude and complain, you could ask for help if you are having trouble. Just a thought
@orenders
@orenders 3 ай бұрын
@@thegamedevcave you cut sooooo much in video edit stage, to reproduce yours 1,5 min i spent 30 min to find buttons and menus. Im not happy to ask 100 questions to you.
@thegamedevcave
@thegamedevcave 3 ай бұрын
@@orenders maybe learn the engine a bit more first on a basic level then, I have a full playlist that goes over the basics too
@metatronorder3565
@metatronorder3565 8 ай бұрын
Awesome post...and after having watched a few, this one was so easy to follow/replicate... Being a nood to Unreal I do have a question though: I followed all the steps yet when I press play or shift the timeline cursor, my model makes the 'kessel run' in like 1 second...clearly..I've done something wrong...can anyone please help me to fix this issue? Thanks in advance and huge thank you to the Game Dev Cave for this post.
@thegamedevcave
@thegamedevcave 8 ай бұрын
assuming all your nodes are the same as mine, you made a float variable that is used to set the timeline's duration. you can edit that variable on the instance you put in your level (assuming you followed along and made it public) It's very likely you have that set at 1, meaning it'll make the whole loop in 1 second.
Unreal Niagara Voxel FLAME System UE4 UE5 Tutorial
14:13
The Game Dev Cave
Рет қаралды 1,7 М.
How To Make An Object Follow A Spline Path - Unreal Engine Tutorial
16:11
THEY WANTED TO TAKE ALL HIS GOODIES 🍫🥤🍟😂
00:17
OKUNJATA
Рет қаралды 2,8 МЛН
Must-have gadget for every toilet! 🤩 #gadget
00:27
GiGaZoom
Рет қаралды 11 МЛН
Неприятная Встреча На Мосту - Полярная звезда #shorts
00:59
Полярная звезда - Kuzey Yıldızı
Рет қаралды 6 МЛН
How to Move MULTIPLE Actors Along a Spine in Unreal
11:51
The Game Dev Cave
Рет қаралды 13 М.
Unreal Engine 4 Tutorial - Splines - Spline Meshes
21:21
Ryan Laley
Рет қаралды 215 М.
Урок 18 | Unreal Engine 4 Blueprint - Spline   Сплайн (подробно)
26:59
Cyberstars - Как создать игру
Рет қаралды 27 М.
How to move things along a spline path - Unreal Engine 5 Tutorial
11:06
Unreal Engine 4 Tutorial - Splines - Moving Platforms
18:12
Ryan Laley
Рет қаралды 48 М.
How to Move a Character Along a Spline in Unreal Engine 5
8:04
Gorka Games
Рет қаралды 39 М.
Nanite for Artists | GDC 2024
22:09
Unreal Engine
Рет қаралды 91 М.
PLEASE just use CASTING
14:18
The Game Dev Cave
Рет қаралды 7 М.
10 Unreal Engine 5 PLUGINS I can't live without!
9:37
Cinecom.net
Рет қаралды 470 М.
Unreal How to Make a Mesh follow a SPLINE
9:08
The Game Dev Cave
Рет қаралды 25 М.
WWDC 2024 Recap: Is Apple Intelligence Legit?
18:23
Marques Brownlee
Рет қаралды 6 МЛН
🔥Идеальный чехол для iPhone! 📱 #apple #iphone
0:36
Не шарю!
Рет қаралды 1,3 МЛН
Samsung S24 Ultra professional shooting kit #shorts
0:12
Photographer Army
Рет қаралды 30 МЛН