Announcement

Collapse
No announcement yet.

Advanced vehicles

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Advanced vehicles

    So I wanted to talk a bit about vehicles.because I don't feel like theres much information surrounding them aside from the car blueprint from epic. Even with the car blueprint bit feels restrictive since I'm just changing the values for drag ,speed ect . I want to build a train that will follow along train tracks . And will rotate and turn towards the direction of the train tracks. However the challenging part is how would I make a. Train follow along a path that closely resembles the train . Anyone got any creative solutions on one practical way of approaching this problem? Plz and thank you

    #2
    Ok I feel like solving problems so here's what I've got. I hope this picture makes sense. The picture shows a 2 car train following a curvy path.
    Click image for larger version

Name:	T1.png
Views:	1
Size:	55.1 KB
ID:	1061254

    Basically the wheels move according to the vector that is perpendicular to their axle on the track as you can see in green, which you can set the wheels rotation based on this. This isn't the entire solution but I thought this would point you in the right direction .
    Last edited by JGrady1206; 11-20-2014, 03:34 AM.

    Comment


      #3
      I wonder how i would get a value like the angle of the train tracks so i know what rotation the axles should be....HMFP

      Comment


        #4
        Hello,
        i just did this for a character with splines: it goes up to stairs and where you want by creating a spline line in editor like you can find in cont example spline map:

        Comment


          #5
          Originally posted by caelanim8ter View Post
          I wonder how i would get a value like the angle of the train tracks so i know what rotation the axles should be....HMFP
          Well one way to do this is to first design a track that can be modeled by a math function that is continuous. Then once you have that, you can do what is called "differentiating" to find the slope of the tangent line at each point along the track. This corresponds to those green vectors (in 2D) I was showing you on the picture. With this, you can rotate the axles correctly with each tick of time and the train will look like its traveling on its path with which is what you want.

          Comment


            #6
            How exactly would you start to implement math functions? Sorry I'm kinda new to this. Would you do it with blueprints . Or is it only possible in the c plus plus

            Comment


              #7
              Oh yeah I just remember math hall

              Comment


                #8
                It should be possible with blueprints (math expression nodes). I'm also pretty new to blueprinting, but check this video out -> https://www.youtube.com/watch?v=SncBymV7sIs

                Is this somewhat like what you want? Notice how the train moves in a path that is not straight. The developers did a good job in my opinion, but I don't know how they did it; they could've done what I keep mentioning even though you never see the train wheels that much . Again this approach takes careful planning, the level designers need to make a train track path that can be easily approximated by a math function, that way the train's rotation and position can change correctly over time.
                Last edited by JGrady1206; 11-22-2014, 01:27 AM.

                Comment


                  #9
                  Awsome I will definitely give the blueprint math functions a look. I had no idea they even existed . Thx for telling me about em

                  Comment


                    #10
                    Splines! I forgot they had that feature . How do they work exactly?

                    Comment


                      #11
                      Originally posted by caelanim8ter View Post
                      Splines! I forgot they had that feature . How do they work exactly?
                      Check out this tutorial by Dokipen, he shows you how to create a road tool using splines which should work well in your situation as well just instead of a road use train track meshes, and have the train use the spline as it's path to follow
                      https://forums.unrealengine.com/show...t-video-series
                      Free Community Ocean & Sky Project || Join us on Discord! || Trello Roadmap

                      Comment


                        #12
                        I actually just watched the tutorials myself and Splines do make things a lot easier. Yeah I guess if I was to solve this problem I would use Splines with some 3D Calculus to determine how to keep the wheels rotated correctly on the tracks during travel.

                        Comment


                          #13
                          Did you take like extra math courses or something? How come you know you will have to use 3d Calculus. I'm only in highschool so its kinda annoying to figure out i need to use calculus to make my train right

                          Comment

                          Working...
                          X