Announcement

Collapse
No announcement yet.

GTA Style Vehicle Interaction - Project File Included

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

  • GTA Style Vehicle Interaction - Project File Included

    Hello there,

    Here you'll find a sample project that lets you drive any number of vehicles that exist in a level, as long as they are based on the same vehicle BP. It is setup in Player Controller BP and making it work with several different vehicle BP's is up to you. And dont forget to add a box(or sphere, doesnt matter) component to your vehicle BP for overlap events as you'll see in Sedan BP's in the project.





    -----------------------------------------


    UPDATE: Thanks to Omar007 the project is now MP ready and it is easier to implement for just single player too. You can download the project from one of the links below.

    Download 1

    Download 2

    4.8.1 Update

    Enjoy!
    Last edited by Jacky; 07-29-2015, 08:33 PM. Reason: Updated new project links
    FREE Color LUT Collection
    FREE Physics Driven Spacecraft Project
    GTA Style Vehicle Interaction
    Dynamic DoF(Depth of Field)
    Camera Crossfade
    Portfolio

  • #2
    Hi Jacky,

    Great tutorial and setup here!

    I gave it a shot and everything worked pretty well.

    Couple of things to note though.

    I flipped one car upside down by hitting it with another car. By being able to still enter the car and exit the camera now flips sideways. So possibly having a check to not allow entry to cars that are flipped upside down would be good.

    Click image for larger version

Name:	Flipped.PNG
Views:	1
Size:	777.5 KB
ID:	1056986

    Also, another thing is there the vehicle does not slow down and stop after jumping out. It will keep it's same trajectory and movement speed. Notice the orange car. It was continually circling me like shark while I typed this!

    Great start for anyone here though to lead off and have some fun! I would love to see more vehicle games from the community! I remember when I bought my PS1 the first game I bought was Twisted Metal and Driver!

    Tim
    Tim Hobson | Learning Resources | Epic Games
    UE4 Documentation
    Wiki Troubleshooting Guides: Lighting | Swarm Agent | Destructibles |
    _____________________________________________
    Follow me on Twitter @TimHobsonUE4 | My Personal Website
    Photons Be Free: Mini-Tutorials and other Curiosities

    Comment


    • #3
      Thanks for trying it out, Tim!

      Yeah, i didnt even think of those issues you found out because i was more focused on handling the possession of multiple cars in the same level. It has been asked a couple of times before and even though i helped some folks out nobody bothered to turn them into a tutorial(even though i asked so nicely!) so i decided to do it myself. -_- I can add those features later on, and if anyone happens to add them before i do feel free to post here please!
      FREE Color LUT Collection
      FREE Physics Driven Spacecraft Project
      GTA Style Vehicle Interaction
      Dynamic DoF(Depth of Field)
      Camera Crossfade
      Portfolio

      Comment


      • #4
        Making and breaking games is fun and hard and I certainly enjoy both. While I do enjoy breaking them they are never perfect on the first release. Great work on the tutorial. It really is a great starting point for anyone looking to do vehicle games with their characters!

        Thank you for taking the time and giving back to the community. It is always appreciated!

        Tim
        Tim Hobson | Learning Resources | Epic Games
        UE4 Documentation
        Wiki Troubleshooting Guides: Lighting | Swarm Agent | Destructibles |
        _____________________________________________
        Follow me on Twitter @TimHobsonUE4 | My Personal Website
        Photons Be Free: Mini-Tutorials and other Curiosities

        Comment


        • #5
          Hi Jacky!

          System looks cool Had a look at your Blueprints from the video and have some remarks

          You really want to stay away from using the "OR"-node when checking if you're in a Sedan or controlling player.

          While you only have one vehicle type (I assume any vehicle is considered "sedan" right now?) I'd recommend using the following instead:

          Click image for larger version

Name:	class_inheritence_bp.png
Views:	1
Size:	31.5 KB
ID:	1056991

          This saves you the trouble whenever you add a new class, you don't need to update this portion of the BP!
          Game Developer @ LODZERO - My Twitter | tomlooman.com UE4 samples & tutorials | C++ Survival Game (Open-source template)

          Comment


          • #6
            Awesome Jacky, I have been meaning to add in some functionality to allow a pawn to enter a vehicle for a while now, will give this a try when I have some free time. Thanks for the demo & tutorial!
            [Free Community Project/Plugin] WIP Dynamic Ocean & Calendar Based Sky
            New Features:: Highly accurate sun/moon position, and lunar phase calculations built into the plugin (base class for the SkyDome blueprint)
            In Progress: Weather simulation w/ volumetric clouds

            Comment


            • #7
              Originally posted by Tom Looman View Post
              Hi Jacky!

              System looks cool Had a look at your Blueprints from the video and have some remarks

              You really want to stay away from using the "OR"-node when checking if you're in a Sedan or controlling player.

              While you only have one vehicle type (I assume any vehicle is considered "sedan" right now?) I'd recommend using the following instead:

              This saves you the trouble whenever you add a new class, you don't need to update this portion of the BP!

              Brilliant! Thanks a lot, Tom.

              I've updated the screenshots and the project file.
              FREE Color LUT Collection
              FREE Physics Driven Spacecraft Project
              GTA Style Vehicle Interaction
              Dynamic DoF(Depth of Field)
              Camera Crossfade
              Portfolio

              Comment


              • #8
                Is it possible to do this with different vehicles in the game such as a sedan and a van?

                Comment


                • #9
                  Originally posted by jeffmorris View Post
                  Is it possible to do this with different vehicles in the game such as a sedan and a van?
                  It is possible. It will be a bit complicated if the van is not a child BP of the sedan so i would just create another child of the sedan and then replace its mesh and defaults with the van's. That way it will be a drop & use vehicle with the rest of the vehicles you have.
                  FREE Color LUT Collection
                  FREE Physics Driven Spacecraft Project
                  GTA Style Vehicle Interaction
                  Dynamic DoF(Depth of Field)
                  Camera Crossfade
                  Portfolio

                  Comment


                  • #10
                    thanks for this Jacky something i've been wanting to try for a long time, was thinking though if you made it so that it worked from "child of vehicle(code file)" might that be better, but then i haven't a clue if it would work

                    btw looks like they updated the docs which should help
                    https://docs.unrealengine.com/latest...nts/index.html
                    about halfway down
                    UT40K:The Chosen - Warhammer 40,000 for UE4
                    ut40kgeodav - UE4 Tutorials

                    Comment


                    • #11
                      Thanks for this great tutorial.

                      Comment


                      • #12
                        In Step 15 of the Entering/Exiting a Vehicle tutorial, how do I get the blue Set Car mode? Which BP should I be working on - Sedan or MyCharacter?

                        Comment


                        • #13
                          Originally posted by Geodav View Post
                          btw looks like they updated the docs which should help
                          https://docs.unrealengine.com/latest...nts/index.html
                          about halfway down
                          Heh...i wouldnt have bothered with this if i knew about that documentation. But i'm glad people are finding this useful and now they can see that link to the documentation as well. Using the vehicle class doesnt work only because of the Box component. You cant generate events without a box component in this current setup, so... But it is doable if you find out whether you are near the car or not with traces or some other way from FPS character side.

                          @Sunboy: Happy to help!

                          @jeffmorris: I havent read through that tutorial yet so i cant help you on that right now.
                          Last edited by Jacky; 09-28-2014, 06:12 PM.
                          FREE Color LUT Collection
                          FREE Physics Driven Spacecraft Project
                          GTA Style Vehicle Interaction
                          Dynamic DoF(Depth of Field)
                          Camera Crossfade
                          Portfolio

                          Comment


                          • #14
                            I printed out the tutorial and went through the tutorial again and it worked. I added two more cars and I can enter/exit any car.

                            Comment


                            • #15
                              Originally posted by Jacky View Post
                              Hello there,

                              Here you'll find a sample project that lets you drive any number of vehicles that exist in a level, as long as they are based on the same vehicle BP. It is setup in Player Controller BP and making it work with several different vehicle BP's is up to you. And dont forget to add a box(or sphere, doesnt matter) component to your vehicle BP for overlap events as you'll see in Sedan BP's in the project.



                              Let me know if you see any oddities or something doesnt work.

                              Enjoy!

                              This is pure class Jacky
                              Haven't been on the forums in a while, due to work pressures - but was greeted by this GEM when I logged in.....
                              It's funny actually, all the time I've been on these and the Epic Games forums, it never occurred to me that you might be the same "Jacky" from YouTube who used to be a GTA modder???????
                              I only ask because we used to have a bit of banter in my UDK tutorials and what not ....
                              If you are, it's a small world , if not, you rock anyway
                              UE4 high res character modelling, rigging for facial and full body animation - HERE
                              Dave Saxon/AKA Lex Luthor Channel
                              Seek And Destroy Games Channel
                              Our Website here.
                              Download free animations here

                              Comment

                              Working...
                              X