Unreal Engine Train Tutorial: Follow the Rails

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 พ.ย. 2021
  • Hello everyone. This is a quick Tutorial, how to create a Train that follows the Rail.
    I used the Version 4.27.1 of the Unreal Engine for this one.
    Discord: / discord
    Playlist: • Unreal Engine Train Tu...
    Train Sound: • Train Ambience - Relax...
    Train: www.unrealengine.com/marketpl...
    Tunnel: www.unrealengine.com/marketpl...
  • แนวปฏิบัติและการใช้ชีวิต

ความคิดเห็น • 92

  • @Seredias.
    @Seredias.  3 หลายเดือนก่อน +2

    I would recommend to set the "Get Rotation at Distance Along Spline" to "World" instead of "Local" 7:50

    • @gasby_V
      @gasby_V 3 หลายเดือนก่อน +2

      Hi, I'm using the lever tutorial to control the forward speed of a ship. Obviously I have to watch this video first and my question is: can I make my Bluprint Class go back and forth with this tutorial? without using a path?

    • @Seredias.
      @Seredias.  3 หลายเดือนก่อน

      @@gasby_V The Spline is nessesary with this concept.

  • @wolkerwolkerovich8591
    @wolkerwolkerovich8591 2 ปีที่แล้ว +3

    Definitely like. Thank you for the video. If you can still have a lesson about trains. Interested in stopping, looping the movement. Thanks.

    • @Seredias.
      @Seredias.  2 ปีที่แล้ว +1

      Of course this will be an Tutorial Series.

  • @lazertiger-to6vt
    @lazertiger-to6vt 5 ชั่วโมงที่ผ่านมา

    I dont know if something changed due to the versions, but if u find trouble finding the float < float or float + float, just put < or + depending on what ur looking for, and ull find them

    • @Seredias.
      @Seredias.  48 นาทีที่ผ่านมา

      Your right, this is one of the Main Changes between UE4 and UE5.

  • @TNTMEKKI
    @TNTMEKKI 2 ปีที่แล้ว +1

    very nice i make this in my project game like metro game

  • @TheKr0ckeR
    @TheKr0ckeR หลายเดือนก่อน

    Exactly what i needed! Thanks for your effort. Are we doing slow-down effect later on? When we close the lever, it shouldnt directly stop, but with a slow down effect. My game will be full of trains so i need a good asset pack for rail-road & splines. Do you have any recommendations to that?
    Another question is how would we do that inside Tick? So instead of delay, i want to be able to move my train in Tick(); but it needs to accelerate like we did with timeline, any tips?

    • @Seredias.
      @Seredias.  หลายเดือนก่อน +1

      Yes, the slow down effect is part of the Train Station Part. Also the Lever and Carriages Part will be interesting for you. Just follow the Playlist.

    • @TheKr0ckeR
      @TheKr0ckeR หลายเดือนก่อน

      @@Seredias. Thank you, are there any way to edit Timeline's max value via blueprint? Since i want to edit my max speed from a variable, i dont want to go timeline and change last frame.

  • @enriquebaeza9949
    @enriquebaeza9949 2 ปีที่แล้ว

    Congrats for 1000 subscribers, I dont understand the cast to node a lot, why do you cast to the third person character. Thanks.

    • @Seredias.
      @Seredias.  2 ปีที่แล้ว +3

      The Third Person Charakter is the Active Charakter in my Case. So the Cast is important to be sure that only the Player Triggers the Event.

  • @dieterlau2816
    @dieterlau2816 10 หลายเดือนก่อน +1

    thank you, Danke

  • @EthanFilms
    @EthanFilms 2 ปีที่แล้ว +2

    How can we store a spline we create within the landscape editor as a variable so we can do this? It'd be super useful, as I've already used it to make a big railroad on my map

    • @Seredias.
      @Seredias.  2 ปีที่แล้ว +2

      Unfortunately it is not possible to use the "Landscape Splines" inside the Blueprint. I tried that too and was disappointed as well.

    • @sofreshprod
      @sofreshprod 2 ปีที่แล้ว

      @@Seredias. we all tried that ah ah ah

  • @teenagerobotstudio6470
    @teenagerobotstudio6470 2 ปีที่แล้ว

    Please show me how to control the car according to your settings, I can't find a video lesson on how to make the car grip the surface and set your maximum speed, answer me if you can help with this😫

  • @henrycooper8486
    @henrycooper8486 2 ปีที่แล้ว

    This is amazing, thank you so much for this beautiful tutorial! Would it be possible to do this in VR as well? For example replace the third person actor with VR? Kind regards :)

    • @Seredias.
      @Seredias.  2 ปีที่แล้ว +1

      Sure, should be working.

    • @henrycooper8486
      @henrycooper8486 2 ปีที่แล้ว

      Thanks :)

    • @henrycooper8486
      @henrycooper8486 2 ปีที่แล้ว

      Hi again :) would it be possible make the train move at play start along the spline with the character inside of it without needing to go through the trigger box? And if so how would you do it? Kind regards :)

    • @Seredias.
      @Seredias.  2 ปีที่แล้ว +2

      @@henrycooper8486 Thats pretty easy, just replace the "On Begin Overlap" with the "Begin Play" Event.

    • @henrycooper8486
      @henrycooper8486 2 ปีที่แล้ว

      You're amazing thank you so much! :)

  • @teenagerobotstudio6470
    @teenagerobotstudio6470 2 ปีที่แล้ว +1

    Go go go!😃😃😃

  • @Emblanefilms
    @Emblanefilms 11 หลายเดือนก่อน

    Damn. I was hoping this would work for a bus mesh I made. I want to have a bus follow a spline around a city that you can get on and off. Unfortunately i faced 2 issues. The first was the collision trigger to start the bus. It teleports my third person character up the road and the bus dissapears. So I tried plug into event begin play directly but the mesh is facing 90 degrees off. If i manually disconnect the get rotation at distance along spline and input -90degrees into setworldrotation it does correct the angle. But the bus also seems to shudder slowly going through traffic lights that im presuming its collision boxs.

    • @Seredias.
      @Seredias.  11 หลายเดือนก่อน +1

      The Train is a specific Situation. For all other Vehicles I would recommend the AI Car Tutorials as you know.

    • @Emblanefilms
      @Emblanefilms 11 หลายเดือนก่อน

      @@Seredias. oh absolutely. I basically gave up trying to make the bus an ai vehicle because the wheels kept falling off.
      Like I have the bus going around the city on a spline using a timer but that's a tutorial I followed a while ago and it's quite different to yours here.
      Was hoping to try somehow use some code from yours into mine but I'm just not good enough 🤣

  • @ambro44
    @ambro44 ปีที่แล้ว

    @Seredias. I am having trouble with keeping my train a consistent speed. I have it set to get to 20 speed after 5 seconds, it speeds up then after 5 seconds hits, it suddenly slows down and stays at a consistent slower speed. any idea why?

    • @Seredias.
      @Seredias.  ปีที่แล้ว

      Yeah that's kind of a Bug in this System, sorry for that. Its better to use an Tick Event to set the Position. I show that in this Part: th-cam.com/video/-nzPshGMSRQ/w-d-xo.html

    • @ambro44
      @ambro44 ปีที่แล้ว

      @@Seredias. Thanks for the quick reply :) curious, have you tried using a lerp function? I have my train moving around the spline via lerp and it's speed is consistent, but it doesn't slow down when it hits the collision box from your part 2 tutorial. Would this not work with a lerp for some reason? Train collision is set to enable overlap functions.

  • @solar9969
    @solar9969 10 หลายเดือนก่อน +1

    Hi I have an issue where the train throws the player out after it starts moving how would I fix this ?

    • @Seredias.
      @Seredias.  10 หลายเดือนก่อน

      Sounds like a Collision Problem. Are you able to run around inside the Train?

  • @Rabbit14
    @Rabbit14 ปีที่แล้ว

    is the path spline in the center of the tracks or outside of the tracks?

    • @Seredias.
      @Seredias.  ปีที่แล้ว

      Depends where the Privot Point of the Train is. In my Case beside the Track.

  • @deeppixelstudio
    @deeppixelstudio หลายเดือนก่อน

    do you have a tutorial for replicating the train for multiplayer?

    • @Seredias.
      @Seredias.  หลายเดือนก่อน +1

      Not yet, will be Part of Season 2.

  • @laurentiupolesciuc2817
    @laurentiupolesciuc2817 2 ปีที่แล้ว

    make a video how to make a controlled car using the Advanced Vehicle System

  • @TheWeeky
    @TheWeeky ปีที่แล้ว

    might be a bit late to all of this but for some reason at the 6:07 part, after i do this tutorial and test how it works my train doesnt move and if i stop the game it shows ("Accessed None trying to read property Path". Node: Branch Graph)

    • @Seredias.
      @Seredias.  ปีที่แล้ว +1

      Did you set the Active Path inside the World? 10:00

    • @milktar2182
      @milktar2182 4 หลายเดือนก่อน

      I'm having the same issue too. Did you manage to fix it?

  • @darkestdaysvideogame
    @darkestdaysvideogame หลายเดือนก่อน

    Can I somehow get the select path option inside the bp since my level pieces generate on start and are not inside level.
    Edit: figured it out, you just have to spawn both actors on begin play insde the blueprint you want and after spawning set spline to active path. Now just to figure ot how to make it go backwards

    • @Seredias.
      @Seredias.  หลายเดือนก่อน

      To go backwards, you need to subtract the Speed from the Distance.

    • @darkestdaysvideogame
      @darkestdaysvideogame หลายเดือนก่อน

      @@Seredias. And about Timeline, Play from start still or play from reverse? Also I've noticed sometimes my cart/train overshoots the path and teleports to the begging and then plays the path again, any idea whats causing that? Either way, thanks for the input, I was a bit stupid and trying to multiply speed with -1 instead of substracting it with distance.
      Though I just tried it and it still seems to teleport me and the cart to the begging if I subtract and doesn't do anything after wards instead of playing sound

    • @Seredias.
      @Seredias.  หลายเดือนก่อน

      @@darkestdaysvideogame The reverse function needs to be a complete separate function where everything do the opposite. So the timeline would go from 0 to -20

    • @darkestdaysvideogame
      @darkestdaysvideogame หลายเดือนก่อน

      @@Seredias. I see, will give it a go, I did separate it but didn't change the timeline. Also I noticed it doesn't work on lower framerates so I multiplied speed with world delta seconds and it seems to be ok.

  • @suryakamalnd9888
    @suryakamalnd9888 2 ปีที่แล้ว +2

    Cool video bro!! Can you redo this in unreal engine 5?

    • @Seredias.
      @Seredias.  3 หลายเดือนก่อน

      There is no different between UE4 and UE5 in this Case.

  • @lildeetime745
    @lildeetime745 2 ปีที่แล้ว

    Hey I need help on making deformable cars like beamng drive for online games please

    • @Seredias.
      @Seredias.  2 ปีที่แล้ว +1

      I worked on that since a while now, but I dont get a good Solution for this. I will let you know if I get something.

  • @user-br1xx4ef4u
    @user-br1xx4ef4u 10 หลายเดือนก่อน

    Your explanation is very nice...and I am enjoying it. Could you send me the train file? Because I can't buy it

    • @Seredias.
      @Seredias.  10 หลายเดือนก่อน

      Since Im using a Content Pack from the Marketplace which Im not the Creator of, its not possible to share it.

  • @hoofdlampje493
    @hoofdlampje493 2 ปีที่แล้ว +2

    my default tab isnt showing on the end

    • @Seredias.
      @Seredias.  2 ปีที่แล้ว

      Which default tab do you mean?

    • @hoofdlampje493
      @hoofdlampje493 2 ปีที่แล้ว +1

      @@Seredias. on 10:03 i cant select a path or anything just doesnt show up

  • @muhammadzeeshannaeem1918
    @muhammadzeeshannaeem1918 8 หลายเดือนก่อน

    i did same , everything is working except Sound , Sound doesn't play when train Travels please help

    • @Seredias.
      @Seredias.  8 หลายเดือนก่อน

      Did you add an Audio Component to the Train Blueprint and set the Wave Sound inside the Details?

    • @muhammadzeeshannaeem1918
      @muhammadzeeshannaeem1918 8 หลายเดือนก่อน

      First of Alla thanks for this series
      i'm your subscriber and video Liker
      at firsrt i got 1sec of train sound
      i converted it in WAV
      then i uploaded in UE project
      Then i did same added "Audio" Component into Blueprint actor and placed it in the train
      as the details shown in this video 3:45, i selected that Train sound and set "1 to 0" in "Volume Multiplier " in the details of Audio Component
      then i coded same as you, but audio isn't playing
      when i set Volume Multiplier 1 in the audio component details it only playes single time, please help @@Seredias.

    • @Seredias.
      @Seredias.  8 หลายเดือนก่อน

      @@muhammadzeeshannaeem1918 Ah I think I know what the Problem is. Open the Wave File in Unreal Engine and check "Looping" to true.

    • @muhammadzeeshannaeem1918
      @muhammadzeeshannaeem1918 8 หลายเดือนก่อน +1

      OMG, you actually fixed my problem. Thank you soo much brother

  • @jefffolkes1722
    @jefffolkes1722 ปีที่แล้ว +1

    Is there still a way to grab the tunnel assets?

    • @Seredias.
      @Seredias.  ปีที่แล้ว

      Oh that's strange. I see that it is unavailable in the Marketplace, but I still can use it. Hopefully the Creator will activate it again.

    • @jefffolkes1722
      @jefffolkes1722 ปีที่แล้ว

      @@Seredias. Anywhere else I could look for those Assets?

    • @Seredias.
      @Seredias.  ปีที่แล้ว

      @@jefffolkes1722 I don't think so, but to be honest I don't know.

  • @CommanderColson
    @CommanderColson 2 หลายเดือนก่อน

    It works but is really stuttery. Is there any way to fix the stutter?

    • @Seredias.
      @Seredias.  2 หลายเดือนก่อน

      Yes, this get fixed in the next Parts.

    • @CommanderColson
      @CommanderColson 2 หลายเดือนก่อน

      @@Seredias. When? There are a lot of videos

    • @Seredias.
      @Seredias.  2 หลายเดือนก่อน

      @@CommanderColson There are 7 Videos in the Playlist, I wouldn't call that a lot, but anyway in this Part here at 8:26 you will find a summary: th-cam.com/video/-nzPshGMSRQ/w-d-xo.htmlsi=WgYVlqqv32CTd_NO

  • @suryakamalnd9888
    @suryakamalnd9888 2 ปีที่แล้ว +1

    Bro can you make a tutorial for a drivable train for train games?

    • @Seredias.
      @Seredias.  2 ปีที่แล้ว +1

      Good Idea, I will do.

    • @suryakamalnd9888
      @suryakamalnd9888 2 ปีที่แล้ว +1

      @@Seredias. thanks!! That should be very useful for my game...

  • @family_in_China
    @family_in_China 3 หลายเดือนก่อน

    I have problem, cant do more then one train )) branch error ))

    • @Seredias.
      @Seredias.  3 หลายเดือนก่อน

      I guess you tried two Trains on the same Spline. With this concept you need a Spline for every Train.

  • @KingofGod2
    @KingofGod2 2 ปีที่แล้ว

    Sir how to make train traffic system ??

    • @Seredias.
      @Seredias.  2 ปีที่แล้ว

      Traffic with other Trains or integrated with the Car Traffic?

  • @itzrajgoyal
    @itzrajgoyal 3 หลายเดือนก่อน

    Bro Please Help! My Train Goes 90% i Do Now Know Why I Tryied Rotating But Noting Works Please help, Whatever I Do I Just Goes backwards, It Just Goes Opposite the direction I Give

    • @Seredias.
      @Seredias.  3 หลายเดือนก่อน +1

      I think this here should help: th-cam.com/video/w7bVhik0TYQ/w-d-xo.htmlsi=CN5mKQWPnWTjV--5&t=60
      In this way you can rotate the Train inside the Blueprint Actor.

    • @itzrajgoyal
      @itzrajgoyal 3 หลายเดือนก่อน +1

      Thanks For Helping ,@@Seredias. You'r Such A Wonderful Content Creator 😊

    • @itzrajgoyal
      @itzrajgoyal 3 หลายเดือนก่อน

      @@Seredias. No Bro It Didnt Worked Out, After I Place My Carriage And Train bp they are well placed at first but when the train starts they change their location , This the the only prob im facing. Thanks

    • @Seredias.
      @Seredias.  3 หลายเดือนก่อน

      @@itzrajgoyal I forgot to say, I would recommend to set the "Get Rotation at Distance Along Spline" to "World" instead of "Local" 7:50

  • @clebo99
    @clebo99 8 หลายเดือนก่อน

    Can anyone post the train sound he has here?

    • @Seredias.
      @Seredias.  8 หลายเดือนก่อน

      Train Sound: th-cam.com/video/0Yvdm_ZgEOY/w-d-xo.html

  • @patricljung3710
    @patricljung3710 2 ปีที่แล้ว +1

    Nice tutorial on using splines to move the train. However, I wouldn't call it an AI Train, in which I expect the use of AI Controller, Behavior Tree, BT Tasks and a Movement Component on the Train. Sorry for nagging, but I've seen far too many videos about "AI" this and that in Unreal which are not really AI or NPC pawns/characters.

    • @Seredias.
      @Seredias.  2 ปีที่แล้ว +4

      Technically you're right, but this is just the Begin of the Tutorial Series. So it will get more complicated.

  • @DJenriqez
    @DJenriqez ปีที่แล้ว

    I know there is not certain definition of AI, but I would not call making train running on actor enter zone AI

    • @Seredias.
      @Seredias.  ปีที่แล้ว

      How would you call a self driving Train, that is not controlled by a Player? Especially in the further Parts. The Collision Box just starts the AI.

    • @DJenriqez
      @DJenriqez ปีที่แล้ว

      @@Seredias. From developer perspective its traing controller by animation node,... (from customer side maybe its AI) ? Even in real life most of autonomous trains are controlled by electric switches and levers, not AI decision... (security norms). Cars in GTA series can be considered AI. But this definitelly not....

    • @Seredias.
      @Seredias.  ปีที่แล้ว

      @@DJenriqez From the developer perspective you are right. A Train can't be an AI cause it has to follow a Static Route. Only the Speed could be calculated based on Static things ( Train Station, Curves etc.). Since I also have an AI Car Tutorial Series, where the Car has to make decisions based on the Environment, I will rename this Tutorial.

    • @DJenriqez
      @DJenriqez ปีที่แล้ว

      @@Seredias. thanks, it is really misleading, I came here because of some AI in unreal to check how it works and I found train following static route :)

  • @sosenkazpolski5884
    @sosenkazpolski5884 10 หลายเดือนก่อน

    I can't set the path for it, it doesn't have that part in the "Default" section of details panel. Everytime I step into the box collider, I get this error in the output log:
    "PIE: Error: Blueprint Runtime Error: "Accessed None trying to read property ActivePath". Node: Branch Graph: EventGraph Function: Execute Ubergraph Train BP Blueprint: Train_BP
    LogScript: Warning: Accessed None
    Train_BP_C /Game/FirstPerson/Maps/UEDPIE_0_FirstPersonMap.FirstPersonMap:PersistentLevel.Train_BP_C_UAID_7C10C9251A3C4C9C01_1925784277
    Function /Game/Blueprints/Train_BP.Train_BP_C:ExecuteUbergraph_Train_BP:007C
    PIE: Error: Blueprint Runtime Error: "Accessed None". Node: Branch Graph: EventGraph Function: Execute Ubergraph Train BP Blueprint: Train_BP"

    • @Seredias.
      @Seredias.  9 หลายเดือนก่อน

      Did you set the Active Path Variable public? 3:15