Arcade Style Car Controller || Unity Tutorial

Поделиться
HTML-код
  • Опубликовано: 23 дек 2024

Комментарии • 293

  • @SpawnCampGames
    @SpawnCampGames  3 года назад +9

    Ya'll kept asking so Part 2 is now up.. (Adding Collision)
    Check it out :
    📺 ruclips.net/video/CpXT5So1Gbg/видео.html
    Also find an updated copy of the script used in this video over there in the description..

  • @ridersforransom9545
    @ridersforransom9545 3 года назад +51

    you are one of the few tutorials that actually takes the time to explain why/how and you deserve applause for it.

    • @SpawnCampGames
      @SpawnCampGames  3 года назад +8

      Thank you. I try to throw in explanations and tips here and there.. :) It's a balancing act for sure. I could make hour long videos if I broke down everything but I do my best to figure out what are the important bits :)

    • @mrshaddow0376
      @mrshaddow0376 3 года назад +1

      how do u make it work?i am stiil trying to figure it out but i don no

    • @orionprime2543
      @orionprime2543 2 года назад

      @@SpawnCampGames listen sir,those hours long doesn't seem long enough😂😂😂you're the best at explaining things

  • @iroroistaken
    @iroroistaken 4 года назад +12

    Pls don't stop
    This is perfect

  • @DarkFlarePrince
    @DarkFlarePrince 4 года назад +12

    I can not tell you enough how much I appreciate this tutorial! You deserve more views!!

  • @FileTh1rt3en
    @FileTh1rt3en 3 года назад +5

    This is an extremely clean tutorial. The descriptions of everything is incredibly concise and I must say the system design is very good. I do think there might be better ways to handle certain things but nothing can be perfect or match every requirement for each person's project. Excellent job.

  • @sumanojha5310
    @sumanojha5310 4 года назад +4

    So good video but soo less views I am gonna share this to my friends and congratulations for 94 subscribers hope you will get 1k soon

    • @SpawnCampGames
      @SpawnCampGames  4 года назад +1

      Thank you so much! :)

    • @sumanojha5310
      @sumanojha5310 4 года назад +1

      @@SpawnCampGames no problem but do you use discord I need some help from a professional in unity just small things which I need in my car game I am making

    • @SpawnCampGames
      @SpawnCampGames  4 года назад +1

      @@sumanojha5310 I do use Discord, although my channel is currently private and invite only.. I can recommend joining the Official Unity Discord. It's a great place to ask for help and I am active there, as well :)

  • @bvra155
    @bvra155 3 года назад +2

    Please keep the good stuff . Love your voice , little jokes and the tutorials . Good job!!!!

    • @SpawnCampGames
      @SpawnCampGames  3 года назад +2

      Well, Thank you fam! I personally don't like the way I sound but I think that's the case with us all. xD.. I try to joke and keep the material fun because that's the way it should be.. Gotta be enjoying what you do!! :) But anyways, thanks for the shoutout and thanks for watching..

  • @leohunter5360
    @leohunter5360 Год назад

    Really appreciate the visual explanations. I taught the only way to create car controllers in unity was by using wheel colliders. Thanks for the insight!

  • @ryanjacoblover
    @ryanjacoblover 3 года назад

    ive been looking for a whole week and the only good tutorial i found is this one. DEfinietly subbing

  • @shivamchauhan2673
    @shivamchauhan2673 3 года назад +2

    Thanks man, this is what I have been looking for about 1 month. You are genius bro. Thanks again for such a detailed and well explained tutorial. You deserve much more.

  • @MaximumLowBlow
    @MaximumLowBlow 3 года назад

    Absolutely phenomenal tutorial. People like you are what make RUclips worth visiting. Thank you so much

  • @ericlassard9
    @ericlassard9 3 года назад +1

    Woaw that's very cool
    -Dani

  • @kotriko
    @kotriko 3 года назад

    Your explanation and the simplicity of the code is perfect. thanks for the tutorial dude

  • @2NICEforYOU
    @2NICEforYOU 2 года назад

    After Doing Some Tweaks It Works Like A Charm Love Your Tutorials Man

  • @Timothymukansi
    @Timothymukansi 3 года назад +1

    This was an incredible tutorial with a genius approach. Keep up the awesome work

  • @biancaracaza
    @biancaracaza 4 года назад +2

    This is exactly what I was looking for! You a real one!

  • @oofvegetable
    @oofvegetable 3 года назад +4

    I like it that you call the bin "SHIT"

  • @argentiignis
    @argentiignis 2 года назад

    THANK YOU, Ive had so much trouble making a working car. This is so helpful!

  • @ShepherdXVII
    @ShepherdXVII 2 года назад

    You are literally a lifesaver! This tutorial is amazing!!!

  • @hehehe_hussain1694
    @hehehe_hussain1694 3 года назад

    your the best coder i ever saw

  • @jedsaxon
    @jedsaxon 3 года назад

    Wow, this was amazing. I did not expect something like this to work so quickly! Thanks!

  • @mozikr9694
    @mozikr9694 4 года назад +3

    This is amazing, thx for this dude.

  • @slycreature972
    @slycreature972 Год назад

    Such AMAZING tutorial! Lots of explanations! Thanks ;)

  • @vaibhavjaiswal799
    @vaibhavjaiswal799 3 года назад

    Thanks, I've been searching for this type of controller for long time

  • @PricelessCold
    @PricelessCold 3 года назад +1

    This is literally AMAZING the only thing that makes it not so viable is the way the car follows normals of the road via using raycast. if it went straight up a 45 degree angle it snaps to the normals resulting in an akward transition.

    • @SpawnCampGames
      @SpawnCampGames  3 года назад

      Thanks! and yes it could use some ironing out and I hope to make a part 2 soon. Lerping between the rotations would make a nicer transition..

    • @PricelessCold
      @PricelessCold 3 года назад +1

      @@SpawnCampGames also a tutorial for sound would be extraordinarily useful

    • @SpawnCampGames
      @SpawnCampGames  3 года назад

      @@PricelessCold also queued up ;)

  • @Runix1
    @Runix1 3 года назад +3

    "There's one problem. The car turns while sitting still."
    Me, who's here for a drifting tank controller: _Nice._

  • @master_kehos
    @master_kehos 3 года назад

    Many thanks for this, it is awesome! One little thing I would say is that if you are not accelerating (either forward or backwards) then you can't turn the car, but is the only thing I saw missing. Awesome job!!

    • @SpawnCampGames
      @SpawnCampGames  3 года назад +1

      there's a part 2 coming out with better turning.. and collision :)

    • @Joanarkj
      @Joanarkj 3 года назад

      @@SpawnCampGames where is iitttt? :(

    • @SpawnCampGames
      @SpawnCampGames  3 года назад +1

      @@Joanarkj sorry its been hectic.. and i'm working on a game of my own part time.. I havent forget and I've got 3 videos in the works..

  • @alpajino5400
    @alpajino5400 3 года назад

    I really appreciate it man! Keep up the good work!

  • @Yannnus
    @Yannnus 3 года назад

    Oh damn, this works!! Thanks a lot, man, amazing tutorial!!!

  • @SebLeCaribou
    @SebLeCaribou 2 года назад

    You're really good. Thank you for this tutorial.

  • @johnnyrod328
    @johnnyrod328 3 года назад +2

    Cool tutorial, really nice work...but i have problem colliding with walls, the car goes inside or the wall until he reach the sphere colider any ideas for that?

  • @GhostSlayerYT
    @GhostSlayerYT 3 года назад +2

    oh WAIT
    what a co-incidence we have the same NUMBER OF SUBSCRIBERS OMG

  • @mathew3267
    @mathew3267 4 месяца назад

    Really nice system but my only concern is how quickly the car accelerates and deaccelerates. How can you get it to ramp up to top speed slower and and come to a stop longer when not on the throttle?

  • @carlosdavidvillarinomendoz9200
    @carlosdavidvillarinomendoz9200 2 года назад

    best tutorial ever, 10u so much

  • @gvishwajith1739
    @gvishwajith1739 4 года назад

    i really loved ur tut bro keep it up and u really deserve more subs btw im ur subscriber

  • @ruicunha2727
    @ruicunha2727 3 года назад +1

    Life saver! Subscribed!!!!!

  • @mpowereer6992
    @mpowereer6992 2 года назад +1

    if someone has problems in physics in 7 minute just dont worry make everything like in video and in 13 minute everything will be working properly.

  • @bruhbruur1740
    @bruhbruur1740 Год назад

    i like it, but the rotation isn't smooth when going up a ramp. i have tried to lerp it, but then i can't steer. can you help me?

  • @BlizAce256
    @BlizAce256 Год назад

    Loved the tutorial. I used it to build a quick car controller but I had an issue that when I stopped pressing forward/backwards I lost my turning. So I swapped in a DOT product and stopped using the moveInput for the steering. Here are my changes :)
    float turnStepVelocity = Vector3.Dot(transform.forward, (SphereRB.position + SphereRB.velocity - SphereRB.position).normalized);
    float turnStep = turnInput * turnSpeed * Time.deltaTime * turnStepVelocity;
    transform.Rotate(0, turnStep, 0, Space.World);
    // float turnStep = turnInput * turnSpeed * Time.deltaTime * moveInput;
    // transform.Rotate(0, turnStep, 0, Space.World);

  • @orlandoviolencestudio8990
    @orlandoviolencestudio8990 2 года назад

    Tks so much for this tutorial, I had some issue due the Visual Studio update but in the end I could finish this tutorial. I was thinking how to disable the rotation when the car is on the ground.

  • @morpog64
    @morpog64 3 года назад +2

    bro i really dont understand what do you did to make the car stop bouncig on the start of the video im using another car model and it keeps bouncing plz explaing in another video how u doit

    • @morpog64
      @morpog64 3 года назад +2

      actually i figured out, i put the "transform.position = sphereRB.transform.position;" on the fixed update since the pivot points of the sphere and the car was in the same exact place and they dont stop bouncing

    • @kerko2588
      @kerko2588 3 года назад +1

      @@morpog64 fucken godsend thank you so much

  • @gabinv930
    @gabinv930 2 года назад

    you're a genius my guy
    tx

  • @foreignwarren7361
    @foreignwarren7361 3 года назад +3

    Hi SpawnCampGames really good tutorial! Can you please tell me how you can get the car skidding a bit more when acceleration is released, it seems to stop turning too quick.

  • @quickgarde1622
    @quickgarde1622 3 года назад +6

    Hey,
    I have a request, if you could do a part 2 about collisions(Solving the issue with parts of the car entering objects). Whilst it might seem simple, Ive tried many things and its just not working!

  • @narrenschlag
    @narrenschlag 3 года назад

    this idea is awesome. Inspiring me so much!

    • @SpawnCampGames
      @SpawnCampGames  3 года назад

      spawncampgames.github.io/project/drift/ArcadeCarV2.png
      I'm glad that I can be of some inspiration :) :)
      Working on Part2 as we speak.

  • @omarvision
    @omarvision 6 месяцев назад

    Do you have the sample code/script somewhere... I'm trying to figure something???
    you move the sphere forward/backward?
    do you turn the sphere? I just see you turning the car parent empty gameobject??? So how does the sphere change the direction it goes in for the rest to follow???

    • @SpawnCampGames
      @SpawnCampGames  6 месяцев назад +2

      I have this project up on github.com/SpawnCampGames/ArcadeCarController github

  • @dreamon5956
    @dreamon5956 3 года назад +1

    Please make a chase camera for the car!Please

  • @WonboShim
    @WonboShim 2 года назад +1

    Thanks, this approach looks very practical. Does the car roll down a hill by itself (and pick up speed)?

  • @HiThere72964
    @HiThere72964 7 месяцев назад

    Hi I am at 11:09 in the video and my sphere is moving but not the actual car model. How do I fix this? Great Tutorial BTW

  • @faisalxi1838
    @faisalxi1838 4 года назад +1

    Thank you, I liked your channel

  • @g5haco
    @g5haco 3 года назад

    Thank you my friend works like a charm

  • @chimingito
    @chimingito 3 года назад +1

    Is it possible to set up a more accurate collider for the mesh of the car, to crash with other cars or walls, I can't figure out how to make the collisions from the car affect the sphere.

    • @SpawnCampGames
      @SpawnCampGames  3 года назад +1

      this is an arcade controller really meant to be viewed top down and have bumping type collisions.. really accurate collisions aren't really something i know how to achieve with this controller.. altho I have been experimenting with collisions and I have a part 2 for this video coming out.. This uses a simple box collider and another rigidbody thats seperate from the car.. and sets its position to match the sphere and rotation to match the car..
      Example:
      gfycat.com/orderlysatisfiediberianlynx

  • @nishantdesai5064
    @nishantdesai5064 3 года назад +1

    I adjusted the pivot for the sphere and the car so that its at the same point just like you did, the transform of the sphere is also 0,0,0 but still the car just bounces and falls below the platform.

    • @SpawnCampGames
      @SpawnCampGames  3 года назад +1

      If your using the same car asset:
      The Car will be @ 0, 0.5, 0
      The Car graphics will be @ 0, -0.5, 0
      The Sphere will be @ 0, 0, 0
      If you pull the sphere outside of the Car gameobject their transforms should match..
      When the car is assembled in the way of the video their transforms will not match..

    • @nishantdesai5064
      @nishantdesai5064 3 года назад

      @@SpawnCampGames Apparently there was a problem while I made the sphere car's child. It works now, thanks!

    • @orlandoviolencestudio8990
      @orlandoviolencestudio8990 2 года назад +1

      @@nishantdesai5064 I'm facing the same issue. What did you do to solve?

    • @anupamverma7677
      @anupamverma7677 Год назад

      How Did You Do It?

    • @mrearl3229
      @mrearl3229 Год назад +1

      @@anupamverma7677 bro I had the same problem, don't really know how but i somehow fixed it I think, believe you just have to be very precise with the pivot point

  • @FauxFemale
    @FauxFemale Год назад

    Haven't finished the video yet but have yet to see an explanation. Why use a sphere? Because of the collider?

  • @abdoulraoufgambo
    @abdoulraoufgambo 2 года назад

    waouh just awesome !!!
    thank you very much

  • @omarvision
    @omarvision 6 месяцев назад

    I don't understand how you got the bouncing to stop?

  • @DylanSnider
    @DylanSnider 11 месяцев назад

    Hey @SpawnCampGames I am struggling with getting the pivots of the CarBody to line up with the MotorSphere.
    I tried to manually change the rotation of my kart mash through Blender so the rotation (X, Y, Z) was all set to 0. I also tried putting the kart in an empty model set in the same location as the MotorSphere. Note that I am using my own model. Not a marketplace model.
    What can I do to manually set the pivot point to where I want so the vehicle doesn't fling into oblivion?

    • @SpawnCampGames
      @SpawnCampGames  11 месяцев назад +1

      Yea, its a thing you just need to fine tune until you get it right.. I could suggest just using primitive shapes like a normal ole unity cube and get that working and then change out the cube for ur artwork..
      If it will help I have the project on Github github.com/SpawnCampGames/ArcadeCarController
      you can click the Green Code button in the top right corner and download the zip file.. Its a normal Unity project. so you can extract it to a new folder and open the project up in Unity..
      could use it as an example to help ya out..

    • @DylanSnider
      @DylanSnider 11 месяцев назад

      @@SpawnCampGames Okay I'll look at it. Thanks for the help.

  • @idlefang5014
    @idlefang5014 Год назад

    Surprised you don't have more followers very clear and alot of explanation and ur not typing at lightning speed so I'm actually able to follow along and not pause every 5 seconds xD
    Two questions though one why didn't you just unchild the motor sphere in the editor instead of script was it just to keep everything together/more clean
    And two how did you get those extra things in ur code like it says what the different variables are like the x y and z or the origin and direction in the ray cast there in gray letters I have the auto complete thing installed but I don't get stuff like that?
    Hope you have a great day

    • @SpawnCampGames
      @SpawnCampGames  Год назад

      The reason I don't unparent the Motor sphere in the editor is because this way you can keep them together as a prefab, and drag it around to a good starting position.
      The things you see are called inline tips/hints. ruclips.net/video/XE5q8A5vz3k/видео.html
      I have a video explaining how to turn them on. They're great for beginners so you can understand your code better. But personally I use them often when I write out a function of something that takes in many arguments
      for example if i have:
      public void SetUpSkybox(Color colorOfSky, float intensityOfLight)
      when I go to type out the function it'll help me know what belongs there.. and also it allows me to quickly glance at functions and know whats being passed in w/o me having to track down the function..

    • @idlefang5014
      @idlefang5014 Год назад

      @@SpawnCampGames oh awesome! ya I was thinking those would save me a trip to Google when writing the more complex functions

  • @jamesxxxyz8775
    @jamesxxxyz8775 3 года назад

    How can i turn the car depending on speed? While standing car should not move. I don't like to press forward or backwards to steer this.

  • @abdulbasitado6180
    @abdulbasitado6180 3 года назад

    Super! How would I tackle things such as maxSpeed, acceleration, deceleration and drifting?

  • @haskii9088
    @haskii9088 3 года назад

    Hi, because I have a small problem, as I did, the same as in the guide and when I am in the car, the same car is moving backwards

  • @le0ndr024
    @le0ndr024 3 года назад +1

    Great video. But is there a way to make the car turn while not going forward?

    • @SpawnCampGames
      @SpawnCampGames  3 года назад +1

      Why, yes.. If you check out the video @ 13:16 You'll see the code before I modified it to only turn while moving forwards and backwards...
      The reason I did it that way is because it sorta turns into a TOP and just spins in place :D...
      If you are talking about turning the car with w/e momentum is left over from accelerating, there are ways to do it but I chose not to for this video because of the nature of the car controller..
      ( This video has gotten a lot of attention so I most likely am going to do a Part 2 where we add onto it. And I'll remember your question when I do :) )

    • @le0ndr024
      @le0ndr024 3 года назад +1

      @@SpawnCampGames You`re awesome. thank you.

  • @random_precision_software
    @random_precision_software Год назад +1

    Have you stopped making videos? I'd like to subscribe see more videos ?!

    • @SpawnCampGames
      @SpawnCampGames  Год назад +1

      If you subscribe I'll start on a new video Today! :)
      let me know what ud like to see

    • @random_precision_software
      @random_precision_software Год назад

      @@SpawnCampGamesI've subbed... the new unity Versions have new features like HDRP clouds and water.. Id like to see a couple of videos on them?

    • @SpawnCampGames
      @SpawnCampGames  Год назад

      @@random_precision_software
      ok coool, I just started getting into URP for my new Space Adventure game I'm currently working on but I haven't done much with either... Would be a good chance for me to learn some things as well..
      The next video probably won't be URP or HDRP since I have to get familiar with it myself first.. BUT a promise is a promise.. And I'm starting a brand new project as I type. :) Thanks for the SUB.. check in tomorrow or the next day (at the latest) for a new video :) :) :) happy developing

    • @random_precision_software
      @random_precision_software Год назад

      @@SpawnCampGames look forward to it!

    • @SpawnCampGames
      @SpawnCampGames  Год назад

      just hit the editing floor :)

  • @Marc-ek6gf
    @Marc-ek6gf 3 года назад +1

    Omg wow thank you so much for this tutorial!! I was trying to make a simple racing game and I tried using wheel colliders but I kept having so many weird bugs, this was so easy and clear and this might have saved my project!!

  • @ricky_3
    @ricky_3 11 месяцев назад

    Is there a Input.GetKey method foor adding force?

    • @SpawnCampGames
      @SpawnCampGames  11 месяцев назад

      The same Input.GetKeyDown would be what you use in any scenario. The rest of the code wouldn't matter
      docs.unity3d.com/ScriptReference/Input.html
      Note, Rigidbody movement should usually be done in the FixedUpdate(). If you put Input in there some of it may be missed because the FixedUpdate() runs at a much slower frame rate.
      Although, it doesn't seem to stop them in examples:
      docs.unity3d.com/ScriptReference/Rigidbody.AddForce.html

  • @Only944
    @Only944 3 года назад

    I'm so close to getting this working. I'm stuck at about 15:30. My car moves much slower and all the setting are correct. The car is not going fast enough to go off the jump. And when it hits the jump the SphereMotor jumps out of the car and everything goes crazy. I can't figure out what's different!

    • @Only944
      @Only944 3 года назад

      I figured out the speed problem for all those doing this tutorial. The ARCADE Car Asset has been updated and some of the prefab cars have wheel colliders. They need to be deleted and the speed will be correct.

    • @Only944
      @Only944 3 года назад

      Problem SOLVED! You have to make sure to use the Prefab car and NOT the Prefab car with Colliders

  • @milanmolnar3820
    @milanmolnar3820 3 года назад

    Hello, this is awesome and so simple. Thank you. I would like to ask for a little help tho regarding streering, how would i approach steering whie decelerating, so the input to forward is no longer active, but the car still carries the initial momentum and i would like to be able to steer in the time window before complete stop.

    • @milanmolnar3820
      @milanmolnar3820 3 года назад

      oh, i found, a question like this that you already answered. :)

    • @SpawnCampGames
      @SpawnCampGames  3 года назад +1

      @@milanmolnar3820 true.. but I only glossed over it.. I'm actually workin on a part two with better steering collision and extras :) stay tuned if u wanna check it out!

    • @SpawnCampGames
      @SpawnCampGames  3 года назад +1

      spawncampgames.github.io/Drift/
      here's a quick web build i threw up.. I'm still tweaking with the steering but I'm assuming this is similar to what you're asking for..

    • @milanmolnar3820
      @milanmolnar3820 3 года назад

      @@SpawnCampGames Thanks :)

  • @tutanchacon
    @tutanchacon 3 года назад

    Excelent! it is very useful!
    One question, why do you multiply by * transform.rotation at minute 18:26?

    • @SpawnCampGames
      @SpawnCampGames  3 года назад +1

      Thanks for the timestamp.. We need to multiply it by its own transform to apply it to our 'FromToRotation' quaternion rotation. Quaternions are magic.. and multiplying a quaternion isn't the same as actually multiplying it.. To be completely honest I've been doing Unity for quite a while now and still can't explain them..
      forum.unity.com/threads/quaternion-rotation-along-normal.22727/
      The 2nd post also explains why this is done.. Sorry I can't break it down in a good way :D

    • @tutanchacon
      @tutanchacon 3 года назад

      @@SpawnCampGames many thanks!

  • @iangraham6730
    @iangraham6730 3 года назад

    Very nice! Thanks for sharing! Is there an easy way to smoothly rotate the car as it enters a ramp and also when it lands? Rather than suddenly jerking the rotation, maybe lerping it to the same rotation as the ramp?

    • @SpawnCampGames
      @SpawnCampGames  3 года назад +1

      yup.. i would just lerp it or slerp it perhaps, towards its new value..

    • @iangraham6730
      @iangraham6730 3 года назад

      @@SpawnCampGames I'll give it a go tomorrow, thanks for the reply!

  • @ramdayalkumawat3712
    @ramdayalkumawat3712 3 года назад

    Nice controller 💥

  • @TheMultiversalDip
    @TheMultiversalDip Год назад

    Anyone know why I need to crank the values up to get any speed, the values in this video still go slow? I'm wondering if theres a reason why this is occuring.

    • @SpawnCampGames
      @SpawnCampGames  Год назад

      In Unity when you are dealing with Physics values, they tend to be very high.. in the thousands. If you are translating.. (moving the objects with its transforms) you can use smaller values.. because its like units per second.. a Unit is a big area in Unity.. (a meter)

    • @SpawnCampGames
      @SpawnCampGames  Год назад

      you can also mess with the physics materials that you apply to things.. as well as the drag and angular drag

  • @amau1660
    @amau1660 2 года назад

    hi! i have a problem with the script at 9:15 ; my car doesn't want to move , i don't find errors and i retype the script but it's the same, can you help me please ? thanks !

    • @artursponchiado7265
      @artursponchiado7265 2 года назад

      Try disabling the "Static" checkbox in the CarModel game object.

    • @teroxplayz6856
      @teroxplayz6856 Год назад

      Do you still have this problem?

    • @theraiden9631
      @theraiden9631 Год назад

      @@artursponchiado7265 I have Static uncheck but still not move

  • @josephventura3632
    @josephventura3632 3 года назад

    Hey, so I ran into a problem, so I have the camera follow the car but when it turns, the camera faces the front of the car and I always want it to be following the back of the car. Any help?

    • @SpawnCampGames
      @SpawnCampGames  3 года назад

      I use the Cinemachine package from Unity.. super simple to set up a good follow camera with that practically drag and drop..
      or u could just track the cars transform and add an offset to put it behind the car.. but the way it drifts probably would be kinda disorienting..

  • @falsecoyote
    @falsecoyote 2 года назад

    Any time my car goes on a ramp it thinks that it's not grounded and I lose control, the ramp is identical to what you used and on the groundlayer mask

    • @SpawnCampGames
      @SpawnCampGames  2 года назад

      Try debugging what the Raycast is hiting..
      I'd also say make sure your Raycast is long enough to reach the ramp..
      Another good way of troubleshooting is by using OnGizmoSelected method or similar and its DrawRay function to redraw your Raycast in the editor window to make sure its where you'd expect it to be.
      Theres a part two where we redo the car and also a link to a project file that you could compare to.
      Maybe one of the two would also be useful to help you figure out where the problem is.

    • @falsecoyote
      @falsecoyote 2 года назад

      @@SpawnCampGames Thanks for the advice, I made the raycast 1.5f long and that fixed the issue, I followed the second guide aswell.

  • @Rikko230392
    @Rikko230392 3 года назад +1

    Guys, please help, my car is constantly slowly goes back, when there is no moveInput.

  • @nishantbhavsar6985
    @nishantbhavsar6985 3 года назад +1

    good work

  • @no_cap2499
    @no_cap2499 2 года назад

    for some reason my scene isn't behaving like ur scene, first difference when I added the sphere to the car it doesn't bounce at all it just falls straight down once I start the game. After I followed everything in the video private void FixedUpdate()
    {
    sphereRb.AddForce(transform.forward * moveInput, ForceMode.Acceleration);
    } this script doesn't allow my car to move even though I properly referenced it and set force to 200 in inspector.
    I'm at time 9:00 and nothing seems to work on my end, I get no error messages
    i'm using unity 2020.3.24f1

    • @SpawnCampGames
      @SpawnCampGames  2 года назад

      I've had a few people have issues with this tutorial.. After helping them out It was normally misspellings in the code.. or them not properly having the layers set up.. I've had this project open in 2021 and 2022 versions of Unity.. If check out Part2 of this tutorial theres a link in the description for the Github page. and on that page theres a UnityPackage you can try importing into a blank project.. You can look around and compare it to yours and see if you can catch the problem.

    • @no_cap2499
      @no_cap2499 2 года назад

      @SpawnCampGames awesome. Thank you for responding in such a timely manner. I'll let you know if it works or if there's any difference

    • @artursponchiado7265
      @artursponchiado7265 2 года назад

      You have to disable the "Static" checkbox in the CarModel game object.

  • @rodrigoviotti6175
    @rodrigoviotti6175 3 года назад +1

    Is there any way to add a collision into the car? I'm trying but it's not working..
    Great tutorial btw!

    • @SpawnCampGames
      @SpawnCampGames  3 года назад +1

      I'm workin on a part 2.. will include collision

    • @STILEXFPS
      @STILEXFPS 3 года назад

      @@SpawnCampGames looking forward to it

  • @PeasantForADay
    @PeasantForADay Год назад +1

    Thanks!

  • @IndoJPN
    @IndoJPN 3 года назад

    i have my car like floating and the sphere is under the car everytime i play how can i fix it?

  • @Edoppiap
    @Edoppiap 3 года назад

    That's really really cool and easy to use instead of wheel collider! But if you want to implement a braking system instead of start go reverse instantly how do you'd do?

    • @SpawnCampGames
      @SpawnCampGames  3 года назад +1

      Glad u found it helpful. For that I'd probably lerp the forward motion towards zero with some sort of multiplier.. and then only if the cars forward velocity is zero then you can reverse.. I'll give it a look.. might upload something to my github if I can quickly get it sorta and send u a reply if I can.

    • @Edoppiap
      @Edoppiap 3 года назад

      @@SpawnCampGames Thanks for the reply, that's a good idea. I'll check your github then, that would be great!

  • @theraiden9631
    @theraiden9631 Год назад

    How do you can move the model with CTRL? Did you set up the shortcut? And My car still fall off the ground.
    And how do you move the car?

    • @SpawnCampGames
      @SpawnCampGames  Год назад

      You'll have to make sure to follow the steps exactly as they are when setting up the rigidbody, maybe pause it and check.. this means the settings of the inspector and especially the order of things in your scene. if u still have trouble theres a link to the full project on my github page of the 2nd video.. might use it to compare

    • @theraiden9631
      @theraiden9631 Год назад

      @@SpawnCampGames Btw, I’m using the code in 2nd video. I wonder if you can make car drift by using brake input like Brake to Drift mechanic.

  • @ghostbyte7699
    @ghostbyte7699 3 года назад

    Hey man great tutorial. I noticed you have small tooltips next to certain blocks of code. How do you enable them please?

    • @SpawnCampGames
      @SpawnCampGames  3 года назад

      If you mean the suggestions that pop-up, thats intellisense. Comes with Visual Studio if your IDE is set up for Unity..
      heres a link to set it up if thats what ur referring to.
      docs.microsoft.com/en-us/visualstudio/gamedev/unity/get-started/getting-started-with-visual-studio-tools-for-unity?pivots=windows
      if its anything else its probably a rider feature.. I'm using Jetbrains Rider for this video.. It's more robust than Visual Studio.
      www.jetbrains.com/rider/
      its subscription based but I was just using the 30 day trial.

    • @ghostbyte7699
      @ghostbyte7699 3 года назад +1

      @@SpawnCampGames Thanks for your reply. Are you still using Rider? Do you recommend it. It looks pretty good tbh. The small notes next to some of your code look extremely helpful lol.

  • @vyse-sen
    @vyse-sen 2 года назад

    this is awesome

  • @Crowley_Grimsbane
    @Crowley_Grimsbane 6 месяцев назад

    For some reason the term 'Rigidbody' along with many of the things he writes doesn't change color for me, can anyone tell me how to fix that?

    • @SpawnCampGames
      @SpawnCampGames  6 месяцев назад

      need to configure ur IDE.. just search Configure "your software" for Unity

    • @Crowley_Grimsbane
      @Crowley_Grimsbane 6 месяцев назад

      @@SpawnCampGames ok thanks

  • @sri_j1683
    @sri_j1683 3 года назад

    how are you getting the suggestion while typing , i never get
    please tell

  • @crimsonshadow1140
    @crimsonshadow1140 3 года назад

    Hey loved the tutorial😁
    Was thinking of turning this script into a F-Zero style hovercraft. How would I got about modifying the script to include airbrakes?, in other works make the ship slowly strafe left or right when the matching trigger is pressed

    • @SpawnCampGames
      @SpawnCampGames  3 года назад

      that'd be easy.. when u AddForce to the sphere you can add in a horizontal strafing speed * your horizontal axis..
      or just add it seperately..
      rb.AddForce(yourForwardForce);
      rb.AddForce(yourSidewaysForce);

  • @teamcollectiveinc2140
    @teamcollectiveinc2140 8 месяцев назад

    I'm half way through the video, I have the script copied exactly, but the car won't move when I hit play. What am I doing wrong?

    • @SpawnCampGames
      @SpawnCampGames  8 месяцев назад

      Not sure. I will say that the way this system works the *setup* of the GameObjects is just as important as the code..
      github.com/SpawnCampGames/ArcadeCarController
      Here is a github link w/ the actual project (as well as the collision part, the 2nd part)
      You can click the Code button to download a zip file and either open the folder as a new project or use the .unitypackage thats included to just add it to another..
      You can use it to compare to yours or just use it as a starting project and work off of it..
      I hope you find the issue, good luck 🍀

    • @teamcollectiveinc2140
      @teamcollectiveinc2140 8 месяцев назад

      Oh wow, thank you! Yah I'll compare it. I fixed the bounce, but then the sphere won't move - if I place the sphere in front of the car, the car will go to it when I run the script but not continue to move away from its origin. @@SpawnCampGames

    • @teamcollectiveinc2140
      @teamcollectiveinc2140 8 месяцев назад

      WAIT. I just realized it works if I use the forward/back arrow keys. 🤦‍♀

    • @SpawnCampGames
      @SpawnCampGames  8 месяцев назад

      @@teamcollectiveinc2140 I use WASD in the video.. But im grabbing that input using Unity's preset Axis' "Horizontal" and "Vertical" You can find them under Edit> Project Settings> Input Manager
      default it uses WASD and/or Arrow Keys but you can change the keys to w/e you'd like..
      InputAxisRaw returns -1, 0, or 1
      InputAxis (without Raw) will return -1 -> 1 but with smoothing already applied.

    • @teamcollectiveinc2140
      @teamcollectiveinc2140 8 месяцев назад

      @@SpawnCampGames Thanks! I thought the car was cycling back and forth independently without key input when you hit the Play button. Is there a tutorial you can point me to for wheel spin?

  • @omarvision
    @omarvision 6 месяцев назад

    you explain well

  • @polarsvisuals4132
    @polarsvisuals4132 3 года назад

    Amazing tutorial, but how did you get all the wheels to turn with the car?

    • @SpawnCampGames
      @SpawnCampGames  3 года назад +1

      They don't curently, but I'll add this in Part 2 :)

    • @polarsvisuals4132
      @polarsvisuals4132 3 года назад

      @@SpawnCampGames Ah, must had been the bitrate messing with my eyes. Thanks, I'm looking forward to it.

  • @haskii9088
    @haskii9088 3 года назад

    Hey generally make yourself asked where do you write these codes? in which program?

    • @SpawnCampGames
      @SpawnCampGames  3 года назад

      I use either Visual Studio 2019, or Jetbrains Rider.. which has a free evaluation...

    • @haskii9088
      @haskii9088 3 года назад

      @@SpawnCampGames thanks

    • @haskii9088
      @haskii9088 3 года назад

      @@SpawnCampGames end pls help, because I have a small problem, as I did, the same as in the guide and when I am in the car, the same car is moving backwards

    • @SpawnCampGames
      @SpawnCampGames  3 года назад

      @@haskii9088 maybe ur forces are reversed.. check ur input keys.. and swap them around.. or change the forces to negative on the positive one and vice versa.. maybe

    • @haskii9088
      @haskii9088 3 года назад

      @@SpawnCampGames o thanks you

  • @hernans10
    @hernans10 2 года назад

    Hello SpawnCampGames, thank you for this amzaing tutorial, i have this in my game and the gameplay is awesome. Just one quick improvement that i had to make in order to deal with some bugs when i was driving the car on terrain with some bumps, the gravity part you have on FixedUpdate i changed the "transform.up" for a world space -Y axis so it is always pointing down no matter the cars rotation, other wise the gravity will make a force on the local Y axis of the car wich can lead to some weierd behaviour on irregular terrain when the car is constantly rotating.
    Cheers!!

    • @SpawnCampGames
      @SpawnCampGames  2 года назад +1

      Hey mate. Glad to hear! I'm just helping people get a basic understanding and hope they take it from there.. awesome to hear u improving it and customizing it the way u need.. Keep it up

  • @CarlJT
    @CarlJT 2 года назад

    Is the brake reverse?? The road assets in low poly are quality

    • @SpawnCampGames
      @SpawnCampGames  2 года назад

      yup same key.. u could for example have the button lerp the speed to 0 at a certain rate... and then once at zero have a bit of a timer to wait Before brake becomes reverse

    • @CarlJT
      @CarlJT 2 года назад

      @@SpawnCampGames would be a great idea. Also was thinking of an e-brake so you can hit it and sharply turn or something like that.

    • @SpawnCampGames
      @SpawnCampGames  2 года назад +1

      @@CarlJT good suggestion if i can find the time ill probably do a part 3 and add even more features.. maybe an ai car too

    • @CarlJT
      @CarlJT 2 года назад

      @@SpawnCampGames that sounds great. I’ve never attempted AI before I was told to use a waypoint system for it though. Never researched into it more but I’m trying to learn more. It’s a process 😂

  • @kamesama4899
    @kamesama4899 2 года назад

    No mater what im doing the car still desapears into oblivion, all is centrated, pivots are at the same position, but when you hit play it ignores all colliders and go down

    • @kamesama4899
      @kamesama4899 2 года назад +1

      Never mind this problem fixed later in the script, for some reason unity it just dont works exactly like yours

    • @koushiksai1232
      @koushiksai1232 Год назад

      How did u fix it??pls tell me

    • @kamesama4899
      @kamesama4899 Год назад

      @@koushiksai1232 sorry it was more than a year so I dont remember what was the problem. Do you finish to copy the script? I believe it fixed it self when he changed something in the script

  • @TETE
    @TETE 2 года назад

    Sphere collider catching edges of aligned cubes

    • @SpawnCampGames
      @SpawnCampGames  2 года назад

      When i find time i go back to my old projects and this is one I need to do just that. It has problems with seperate pieces.. The best thing to do is make your terrain / racing course 1 piece.. Ramps and things also should start shallow and then get steeper overall... I'll open it back up and a try to apply some sort of band-aid to prevent it..

    • @SpawnCampGames
      @SpawnCampGames  2 года назад

      So, I'm sure, When you travel over two pieces that are connected it hits it and does a little bounce?

    • @TETE
      @TETE 2 года назад

      @@SpawnCampGames yeas exactly

    • @TETE
      @TETE 2 года назад

      @@SpawnCampGames your tutorials are actually so good and why did you stop making those

    • @SpawnCampGames
      @SpawnCampGames  2 года назад

      @@TETE Started working on my own project and just did a game jam.. I have abunch of videos lined. up just gotta get off my butt and finalize em and get em ready for upload :)

  • @heartstone9438
    @heartstone9438 4 года назад +1

    good asset

  • @eufrasiodev1213
    @eufrasiodev1213 3 года назад +1

    Very good tutorial!
    It would be cool if we could download the script

  • @kioka2
    @kioka2 3 года назад

    Is there any way for the car to gradually gain speed? Thanks for the video, amazing !

    • @SpawnCampGames
      @SpawnCampGames  3 года назад +1

      Yes! a simple way I can think is to use a lerp...
      docs.unity3d.com/ScriptReference/Mathf.Lerp.html
      add a few extra variables currentSpeed and lerpSpeed.. and adjust it before you pass it into the car's moving logic..
      something along the lines of If(Input.GetKey(KeyCode.W)
      {
      currentSpeed = Mathf.Lerp(currentSpeed, speed, lerpSpeed);
      }
      else
      {
      currentSpeed = Mathf.Lerp(currentSpeed, 0f, lerpSpeed);
      }
      and then pass currentSpeed into the function instead of speed you had before..

    • @kioka2
      @kioka2 3 года назад

      @@SpawnCampGames Thank you man! Stay safe!

    • @SpawnCampGames
      @SpawnCampGames  3 года назад +1

      thanks, you too friend!

  • @probablyaplacebo3642
    @probablyaplacebo3642 3 года назад

    nice but if you are coasting to a halt but not applying forward input the car wont steer.

    • @SpawnCampGames
      @SpawnCampGames  3 года назад +1

      You can simply use an if / else statement and then use the sphere's velocity.. to see if its moving instead of using the key presses.. this is how i would do it if i were to expand it out..
      if(sphereRB.velocity.magnitude >= 0.1f)
      { `steer` }
      else
      { `cant steer` }

    • @probablyaplacebo3642
      @probablyaplacebo3642 3 года назад

      @@SpawnCampGames That only partially solves the problem as the car will rotate until it comes to a stop but won't actually steer because no force is being applied to its transform.forward.
      As soon as I saw a system like this a while ago I replicated it and fell into the same trap.
      There is a simple solution.

  • @anupamverma7677
    @anupamverma7677 Год назад

    My Car Does Not Stop Bouncing Even After Changing The Coordinates Of The Sphere