Simple Checkpoint System in Unity

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 พ.ย. 2024

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

  • @CodeMonkeyUnity
    @CodeMonkeyUnity  3 ปีที่แล้ว +8

    🌐 Have you found the videos Helpful and Valuable?
    ❤️ Get my Courses unitycodemonkey.com/courses or Support on Patreon www.patreon.com/unitycodemonkey

    • @bitingtodal
      @bitingtodal 3 ปีที่แล้ว

      I love your videos

    • @dyll8829
      @dyll8829 3 ปีที่แล้ว

      Can you make a video about air checkpoints

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

      @@dyll8829 It's the same thing really, just move the colliders into the air

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

      Can you do a video about cooking a torchic

  • @trunkostudios
    @trunkostudios 3 ปีที่แล้ว +11

    Watching this makes me think of all the MarioKart best time videos where they try to exploit the checkpoint system to finish the laps in a few seconds or so.

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

    I am making a racing game and I was making a long script for resetting the vehicle until I saw this video. Loved it 😍❤❤

  • @zombievirals
    @zombievirals 3 ปีที่แล้ว

    I'm pretty sure I'll be using this checkpoint system on every racing game I make from now until the end of time!! I tip my hat to you good sir!!

  • @CodeMonkeyUnity
    @CodeMonkeyUnity  3 ปีที่แล้ว +9

    💬 Simple yet very useful system! Guide the player on a Race Track or really on any path you want!
    Stay tuned for a video on a Car Driver using Machine Learning and another one using Classic AI!

  • @TheGameGuy
    @TheGameGuy 3 ปีที่แล้ว +6

    Awesome Mate! Another way to do this would be making a list of transforms for all the checkpoints on the track and when the player picks one you just set the position of the checkpoint to the next transform in the list and keep track of the checkpoint count and finally when the player reaches the last checkpoint you enable the lap checkpoint and for multiple laps you just repeat the same checkpoints starting from back from checkpoint one.

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

    Oh my God. How I love the racing tutorial

  • @lee1davis1
    @lee1davis1 3 ปีที่แล้ว

    This is really cool to see you work in 3D

  • @dbweb.creative
    @dbweb.creative ปีที่แล้ว

    Recently I've seen an interesting approach: check which direction player EXITS the checkpoint. Then based on that can spawn/despawn things in a room and do all sorts of transitions pertinent to a zone.

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

    Love the way you type

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

    Shortly but surely you are moving forward with covering the topic we need to learn. 👌. Keep making more content.

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

    Ooh neat I've been wondering how to implement something like this

  • @jean-michel.houbre
    @jean-michel.houbre 3 ปีที่แล้ว +1

    Thanks for the great video and the very clear scripts.

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

      Sir can give link of it

  • @IyaB
    @IyaB 3 ปีที่แล้ว

    This was exactly what I needed like 1 month ago😅

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

    Love This :D Interestign and good way of doing Chekpoint :D
    i did it the lame way but it worked with tags(Chekpoint1,Chekpoint2,etc) hehe :D

  • @matijavujic2990
    @matijavujic2990 3 ปีที่แล้ว +4

    Can you make tutorial about ledge climb?

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

      That would be interesting, I'd love to do some more 3D focused tutorials

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

    Just had this idea,How about a video in which you review some of our code and try to compare it with your cleaner code? Maybe you could give us a programming challenge or something of that sort ,and then review that code...Seems like an interesting topic for a video!

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

      That would be interesting but might be tricky to make into a video. I have thought about doing some playtesting/review of audience games.

    • @sundarakrishnann8242
      @sundarakrishnann8242 3 ปีที่แล้ว

      @@CodeMonkeyUnity hmm 👍🏼

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

    Can you make an tutorial how to do a car position , 1º place , 2º place.....tks

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  3 ปีที่แล้ว

      Just add cars to a list as they pass the last checkpoint

  • @theturkish1373
    @theturkish1373 3 ปีที่แล้ว

    Great video pal! Keep with this informative course, you are helping thousands!

  • @rajdeepdas86
    @rajdeepdas86 3 ปีที่แล้ว

    Fantastic tutorial. Exactly what I needed. So helpful.

  • @tiggerable
    @tiggerable 3 ปีที่แล้ว

    Excellent and helpfull! I had some issues extending this with a finish but then realized I Could put the finishline (from where I start to ride) at the bottom of the index so it doesn't get triggered until a complete lap. Then do a check to see if all checkpoints where passed from the finishline with a extra script and it works!

  • @omiorahman6283
    @omiorahman6283 3 ปีที่แล้ว

    thank you for your hard work

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

    hello, these tutorials are great! is there an updated version of this? I am having problems due to the torch and python versions used in these videos, also, is there any difference doing this on a Mac? thank you!!

  • @mastermuke411
    @mastermuke411 3 ปีที่แล้ว

    I was wondering what your thoughts are on how to best have vehicles move withing a city grid type layout in a basic RTS structure (left click select and right click move). Pretty safe to say that using the navigation component is out as it would cause the vehicles to go all over the road and not follow the simple right/left lane streets. Would using a system of connected nodes be best? I assume with that kind of system you would simply find the node closest to the right click input and just send the vehicle there.
    Thanks for your time.

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

      For a City Builder game? You'd probably use Splines to define the path on each side of the road and move the vehicles along the splines th-cam.com/video/7j_BNf9s0jM/w-d-xo.html

    • @mastermuke411
      @mastermuke411 3 ปีที่แล้ว

      @@CodeMonkeyUnity Funny, I just watched that video last night, seems like a great solution. In terms of coding, what would be the best way to organize the nodes in your opinion? Since there are intersections and the vehicle has different pathing options, perhaps some kind of tree nodes?
      Thanks again.

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

    There was a Mario Kart ad on the video

  • @soroushmirzaee6888
    @soroushmirzaee6888 3 ปีที่แล้ว

    Great tutorial thank you.
    Your keyboard sounds like you are pressing down on a bowl full of small chunks of bones

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

    For some reason the other.TryGetComponent(out Player player) doesn't work because the type or namespace 'Player' could not be found. What is the issue? I don't get it. Please help

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  3 ปีที่แล้ว

      The issue is you don't have any class named Player

    • @kinlyki
      @kinlyki 3 ปีที่แล้ว

      @@CodeMonkeyUnity and how would I make that class? I'm working on a collaboration project and they already had controls and stuff for our player character car done.

    • @kinlyki
      @kinlyki 3 ปีที่แล้ว

      @@CodeMonkeyUnity another issue is the right checkpoint wrong checkpoint part, for some reason my first checkpoint was read as the wrong checkpont, but my second one was the correct checkpoint
      EDIT: turns out I needed to put the checkpointSingleList = new List();
      code outside the foreach loop.
      EDIT2: is there a tutorial that supplements this so I can get my car to respawn at the checkpoints?

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

      @@kinlyki Im waaay late to reply to this but ive since learned that you need a script named "Player" which is attached to your car

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

    Mr. Code Monkey! Thanks for the awesome video, maybe you can help with a problem I'm having?
    I copied your code exactly but when any car other than the player controlled one goes through a checkpoint it says "ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
    Parameter name: index".
    I've added the cars to the TrackCheckpoints list in the inspector

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

      What line is throwing that error? Sounds like maybe you're not initializing the List of checkpoints at all, that error means the index you're using is < 0 or above the max amount

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

      @@CodeMonkeyUnity int nextCheckpointSingleIndex = nextCheckpointSingleIndexList[shipTransformList.IndexOf(shipTransform)];
      That's the line throwing the error. I think I am initializing the List of checkpoints in line 33 under the Awake function;
      nextCheckpointSingleIndexList = new List();
      It's odd because when my player controlled car goes through a checkpoint I get the Debug.Log showing "Correct", but when my AI controlled car goes through a checkpoint I get the "ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
      Parameter name: index" error.

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

      @@OwzyBrand It strictly depends on what exactly you consider the Collider that interacts with the Checkpoint. In my case, it turned out to be a collider of a "Body" Game Object, hidden inside the prefab of a car itself. And Transform is transform of this Collider.
      int nextCheckpointSingleIndex = nextCheckpointSingleIndexList[carTransformList.IndexOf(carTransform)];
      This value should match the index of Collider element in Car Transform List

  • @eisi-ink
    @eisi-ink 3 ปีที่แล้ว

    Had to set the speed to 0.5, but it worked :)

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

    is there a way to make sure the car goes through the checkpoint in a certain direction? like identify the collision on the first box edge -> second box edge and make sure they're in the right order...?

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

      You can calculate the Dot product between the car forward and the checkpoint forward. If it's above 0 then they're both facing the same direction.

    • @iamblinkin
      @iamblinkin 3 ปีที่แล้ว

      @@CodeMonkeyUnity Thank you! And extra additional thank you for all you've done and continue to do, your channel is invaluable! :)

    • @apersonthatsucksatnames1133
      @apersonthatsucksatnames1133 3 ปีที่แล้ว

      @@CodeMonkeyUnity I don't exactly understand. Can you simplify that so I can make a car ai that won't drive backwards? (ironically enough I was doing it with your other video on mlagents)

  • @HK-Labs
    @HK-Labs 3 ปีที่แล้ว +1

    13:58 I get this in the console, "ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index" Any suggestions on how to fix this?

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

      Sounds like you're trying to access an index in an array that is larger than the size of the array

    • @HK-Labs
      @HK-Labs 3 ปีที่แล้ว +1

      @@CodeMonkeyUnity I found the solution. I was actually populating the CarTransform list with the parent of the car, instead of the gameobject, which is a child of the parent gameobject, that contains the rigidbody and collider! 😅. Thank you for the tutorial, tho. Really amazing.!!!!

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

      @@HK-Labs Getting same error, could you explain like I'm five?

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

    Hey Monkey, im currently trying to figure out grabbing the checkpoint child objects and I have my find function, do I use the Container Objects name of the child objects name when using that particular function?
    Thanks!!!!!

  • @maxihuenu
    @maxihuenu 3 ปีที่แล้ว

    When going from one CHECKPOINT to the other, the CONSOLE marks me as both correct and wrong, might you help me? Thanks

  • @iVadik1
    @iVadik1 3 ปีที่แล้ว

    I really like the control mechanics. Do you have a course on making this game? I am ready to buy it to repeat it in my game.

  • @walney2008
    @walney2008 3 ปีที่แล้ว

    hello, in the world of submarines game, how to do the movement mechanics? with constant speeds, and the system that marks the ship to fire the torpedo?

  • @DeLaBerni
    @DeLaBerni 3 ปีที่แล้ว

    Hey I have a question, how I get a Vector3 for the last Checkpoint I have passed, because I want to reset my Car if I miss one Checkpoint to the last one ..

  • @tuvokjohannsen123
    @tuvokjohannsen123 3 ปีที่แล้ว

    Just one question. Will there be a Multiplayer Series?

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

      I'd like to cover it but no idea when

  • @foreignwarren7361
    @foreignwarren7361 3 ปีที่แล้ว

    hi Monkey, at 2:13 whats the difference between what you using and if you just used a tag as in if (other.gameobject.tag == "Player") ?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  3 ปีที่แล้ว

      Tags are based on strings which are very error prone, if you accidentally type "player" everything will break and it will be tough to find out why. Not to mention they're pretty costly in terms of performance.
      You should always avoid using strings whenever possible.

    • @foreignwarren7361
      @foreignwarren7361 3 ปีที่แล้ว

      @@CodeMonkeyUnity thanks Monkey...you the best

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

    Thank you.

  • @guridoraccoon6375
    @guridoraccoon6375 3 ปีที่แล้ว

    awesome!

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

    could do with typing a bit slower i can hardly keep up XD good tutorial though haha

  • @kinlyki
    @kinlyki 3 ปีที่แล้ว

    Excuse me, but the serialize field for list of car transform doesn't really help me, as the number of cars spawned in my game are dependent on how many people connect to it. how do I make it so that the list is filled up based on the number of cars with the tag player?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  3 ปีที่แล้ว

      It's just a list, whenever you spawn a new player just do list.Add(newPlayer);

  • @TheFlyingRonin
    @TheFlyingRonin 3 ปีที่แล้ว

    Hmm i was wondering would it be possible to use this in a multi scene game? Like if i want to save my character's progress thus far like in sekiro or dark souls

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  3 ปีที่แล้ว

      Sure, you can save the current checkpoint index before you go to a new scene

  • @Mrazgoodaz
    @Mrazgoodaz 3 ปีที่แล้ว

    I mostly stopped at around 7:20 since I need it for a single-player game, and once I added the TrackCheckpoints to an empty and added CheckpointSingle to all my CheckpointSingle objects, I get a "Object reference not set to an instance of an object" error.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  3 ปีที่แล้ว

      You have something set to null, use Debug.Log to identify what th-cam.com/video/5irv30-bTJw/w-d-xo.html

    • @Mrazgoodaz
      @Mrazgoodaz 3 ปีที่แล้ว

      @@CodeMonkeyUnity TrackCheckPoint.PlayerThroughCheckpoint(this); is giving off a null for some reason. I think it's because my Player component doesn't have the ability to maybe get a variable? How would I go about doing this for the if statement of "TryGetComponent."

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

      Check if you attached the scrip to the "Track" component. In my case I forgot to do it xD.

  • @DavidThemanoy
    @DavidThemanoy 3 ปีที่แล้ว

    Can you show me how to make a lap system using the checkpoint?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  3 ปีที่แล้ว

      Put the first checkpoint right on the beginning, when the checkpointIndex loops back then you have a full lap

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

    1:59 Can anyone explain this if-statement, what does it actually check for?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  3 ปีที่แล้ว

      It tests if the "other" object has a Player component/script, if so it returns true and assigns the player variable with the component.
      So in this case it's used to identify if the player is the one that went through the collider.

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

      @@CodeMonkeyUnity Thank you. I think its just that Im not familiar with "out" :D

    • @DerPhiL
      @DerPhiL 3 ปีที่แล้ว

      @@CodeMonkeyUnity who should also enter the collider then the "player"? AI? other players? or other objects?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  3 ปีที่แล้ว

      @@ScilexGuitar "out" means that parameter is an output parameter, so the variable that you pass in there will be modified by the function

    • @ScilexGuitar
      @ScilexGuitar 3 ปีที่แล้ว

      @@CodeMonkeyUnity So what does the function "TryGetComponent" do to the passed in player variable in this case?

  • @gundikailesi
    @gundikailesi 3 ปีที่แล้ว

    Code Monkey you are best.
    But i need realtime position show on screen (e.g. 1/8 - 5/8 etc.)

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

      Just do some logic by taking the checkpointIndex of each car. A car on index of 3 is ahead of another one on index 1

  • @shawnmongillo2684
    @shawnmongillo2684 3 ปีที่แล้ว

    If Player 1 goes through the wrong checkpoint (let's say they skipped checkpoint 5) won't both players see checkpoint 5 light up? Worse, if Player 2 also goes through a wrong checkpoint (let's say player 2 skipped checkpoint 4) won't both players see checkpoint 4 and checkpoint 5 glowing, and therefor not know which one to go through?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  3 ปีที่แล้ว

      Yes, the logic is set up to handle multiple cars but not the visual. One way to handle that would be if all the other cars were driven by AI then for the visual you would only Show when the player car went through the wrong checkpoint.

  • @walker-snow
    @walker-snow 3 ปีที่แล้ว

    You could use race track meshes triangles instead ;)

    • @DerPhiL
      @DerPhiL 3 ปีที่แล้ว

      whats this :)?

    • @walker-snow
      @walker-snow 3 ปีที่แล้ว

      @@DerPhiL it's not a one-click solution i can't explain it all
      . But you won't have to add colliders manually with it.

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

    this doesn't work for multiplayer does it? since the data is stored in the checkpoints instead of the player

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

      In multiplayer you would use the same logic but only keep track on the server

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

    please help i copied the code at 2:16 but i get an error that says: Assets\MST_Creator\Car Controller For Unity\Scripts\death.cs(10,47): error CS0118: 'player' is a variable but is used like a type , how do i fix this?

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

      Not sure what your code looks like but in the out parameter you should first write the type then the variable name. out Player player
      You're using the "player" variable as a type somehow

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

    My Console does not print any message when using other.TryGetComponent one?

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

      Maybe you forgot to add the component? Maybe the collision isn't triggering? th-cam.com/video/Bc9lmHjqLZc/w-d-xo.html

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

    I seem to have an issue were when I go through a checkpoint the mesh renderer does not turn off (It does have mesh.enabled = false ). How do I fix this?

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

      Maybe you have two mesh renderers on top of one another? Add Debug.Log(mesh); to see exactly what you're disabling

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

      @@CodeMonkeyUnity I changed something in my code and it fixed my mesh renderer issue however it now says that the checkpoint is correct and wrong.

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

      @@CodeMonkeyUnity I have fixed the issue. Thank you for helping

  • @marioshusband3700
    @marioshusband3700 3 ปีที่แล้ว

    May you please do a mission waypoint tutorial? I've been trying to make a waypoint system for a long time, but I can't figure it out.

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

      Something that points to a target? I made that here th-cam.com/video/dHzeHh-3bp4/w-d-xo.html

    • @marioshusband3700
      @marioshusband3700 3 ปีที่แล้ว

      @@CodeMonkeyUnity Yes, thank you!

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

    I'm getting a Null Reference Exception at the foreach loop. help me pls

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

      Add Debug.Log to find what is null unitycodemonkey.com/video.php?v=5irv30-bTJw

  • @foreignwarren7361
    @foreignwarren7361 3 ปีที่แล้ว

    Why cant my PlayerCar object get detected in this line? private void OnTriggerEnter2D(Collider2D collider)
    {
    if (collider.TryGetComponent(out PlayerCar playerCar))
    {
    }
    }
    is just underlined in red

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  3 ปีที่แล้ว

      Sounds like you don't have any class named PlayerCar

    • @foreignwarren7361
      @foreignwarren7361 3 ปีที่แล้ว

      @@CodeMonkeyUnity oh a script sorry thought it was an object in the hierarchy

  • @DavidThemanoy
    @DavidThemanoy 3 ปีที่แล้ว

    I don't know what (out Player player) means, but I'm using a car controller in Unity.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  3 ปีที่แล้ว

      The out keyword in C# lets you define a parameter that will be set to some value inside that function.
      In the case of TryGetComponent it tries to find that component, if it finds it then it assigns it to the player variable.

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

      @@CodeMonkeyUnity Here's an error: The type or namespace name 'Player' could not be found (are you missing a using directive or an assembly reference?

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

      @@DavidThemanoy No Player Component inside your GameObject. Try to create an init.cs script and assign it to the player (no need to write anything inside that script) and then TryGetComponent(out init name). I hope it helps!

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

    Hello everyone i need help my ontriggerenter doesnt work not only it but triggerexit nor collison enter none of them works , idk why cant even debug.log, howerer right after declaring ontriggerenter function if i put ";" sign it does work but it registres everything goes through it
    It worked in first try i needed to modify code to suit my project
    I even created new project file it doesnt work there either
    Please help

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

      I made a video on collisions here th-cam.com/video/Bc9lmHjqLZc/w-d-xo.html
      Make sure you're not mixing 2D and 3D components

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

    howcan we place checkpoints procedurally

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

      Make it into a prefab and just spawn it. The bigger question is how do you make a procedural track, but if you've already solved that then it should be easy to add waypoints

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

    When I start the game, I get two problems.
    1- NullReferenceException: Object reference not set to an instance of an object
    TrackCheckpoints.Awake() (at Assets/CheckPointSystem/TrackCheckpoints.cs:12)
    2- NullReferenceException: Object reference not set to an instance of an object
    CheckpointSingle.OnTriggerEnter (UnityEngine.Collider other) (at Assets/CheckPointSystem/CheckpointSingle.cs:12)

    I don't know why, but I did what you did, can you help me?

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

      Use Debug.Log to find out what is null unitycodemonkey.com/video.php?v=5irv30-bTJw

  • @random_precision_software
    @random_precision_software 3 ปีที่แล้ว

    I've just started something like this myself. Codes anyone know how to do a live wallpaper on android?

  • @johnnythesilverhand
    @johnnythesilverhand 3 ปีที่แล้ว

    how can i sort racers position by checkpoint?

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

      just get which checkpoint is their next and compare

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

    i get an error for foreach (Transform checkpointSingleTransform in checkpointsTransform)
    {
    CheckPointSingle checkpointSingle = checkpointSingleTransform.GetComponent();
    checkpointSingle.setTrackCheckpoints(this);
    checkpointSingleList.Add(checkpointSingle);
    }
    Object reference not set to an instance of an object
    TrackCheckpoints.Awake () (at Assets/Scripts/TrackCheckpoints.cs:16) is my error i cant figure it out someone helpp DX

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

      What's the solution ?

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

      Try getting rid of the .Find bit it worked for me

  • @kheelansarathee6386
    @kheelansarathee6386 3 ปีที่แล้ว

    how would you setup a lap system

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  3 ปีที่แล้ว

      When the player goes through the checkpoint on index 0, it's a new lap

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

    can someone help me, i cant the see the 'player' variable, it gives me an error, at 2:01, pls help i cant figure out why this happens

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

      Then it sounds like you don't have any class in your game named Player

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

      @@CodeMonkeyUnity where do i have to put the player class?

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

      @@nitro5gaming463 Inside your Player or Car Gameobject.

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

    noice

  • @antalervin19-
    @antalervin19- 2 ปีที่แล้ว

    Does It work in multiplayer?

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

      Not sure what you mean by that, there's nothing here related to single or multiplayer, it's just physics and basic logic. You could run this logic both on a server and a client

    • @antalervin19-
      @antalervin19- 2 ปีที่แล้ว

      @@CodeMonkeyUnity Thanks Man!

  • @JayTuut
    @JayTuut 3 ปีที่แล้ว

    This seems complicated for me sorry, (I'm only doing my 3rd Unity unit in Uni), I thought it would be simple to have a checkpoint gameobject that is a floating totem (like a collectible) and if you get in the radius, you've hit that checkpoint, then u go get the other one
    Problem is, not knowing how to do the radius, then also record and output at the end of the game the time stamp of when the checkpoint was reached, and making it have a "indicator that lights up when its active, dims when the checkpoint is inactive"... idk.

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

    didn't work for me. :(. I'm using UNITY 2021.3.15f

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

      What does "didn't work" mean? You have a compiler error? Runtime error? It doesn't behave as expected?
      Just saying "didn't work" doesn't provide any info, theres nothing I can do to help if I don't know exactly what doesn't work

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

      @@CodeMonkeyUnity No compiling errors. Just didn’t display anything in the console. :(

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

      Hello. I've come to say that i did it. it worked. there were some mistakes i made, in the hierarchy. I'm sorry, for everything. thank you for this useful code. Now, that part where you showed how to make the system to support multiple cars, it gave errors, in my console.

  • @pytchoun140
    @pytchoun140 3 ปีที่แล้ว

    Where can i have car controller please ?

    • @jamesxxxyz8775
      @jamesxxxyz8775 3 ปีที่แล้ว

      Asset Store there are free ones too

    • @pytchoun140
      @pytchoun140 3 ปีที่แล้ว

      @@jamesxxxyz8775 exemple?

  • @england4tommy898
    @england4tommy898 3 ปีที่แล้ว

    This man is not teaching - he is just promoting himself.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  3 ปีที่แล้ว

      What part of the video did you find lacking? It covers the entire Checkpoint System starting from a completely empty script, what else were you looking for?

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

      @@CodeMonkeyUnity The video was VERY useful, just ignore the trolls always wanting to hate on everything

  • @LD-dt1sk
    @LD-dt1sk 3 ปีที่แล้ว

    Anyone has a good blender tutorial? I suck at it and i need to learn it

  • @oyunlarveparodiler3221
    @oyunlarveparodiler3221 3 ปีที่แล้ว

    Alakasız ama merak ettim,code monkey izleyen başka türk var mı?
    (If you don't understand just ignore that comment)

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

    How does anyone remember all of this?

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

      It's not a question of memory, it's a question of understanding the logic behind how systems work. So I don't think "how did I do a checkpoint system before" I just think "ok I need some way of testing when the car goes through a point, then keep track of how many of those points, etc"

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

    Sir can u give me script 😅

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

      Sir pls reply 😔🥺

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  3 ปีที่แล้ว

      There's a link in the description

    • @indiandev1588
      @indiandev1588 3 ปีที่แล้ว

      @@CodeMonkeyUnity Please validate your email to download files
      Sir pls help me