Making of Low Poly Racing - ep 5 - Checkpoints and Lap Times - Unity

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] okay [Music] guys I see that you're creating some they're quite cool games the disk or has been filling up with there quite a few racing projects low poly racers much further away than I've managed to get on my one TV I got this is quite some cool cool games one guy made a like a Mars racing game that was super cool another guy made a really intricate track with their loads of AI and cars and stuff that looked amazing too and I've seen there quite a few projects so thrilled about that and sorry internet for filling up everything with low poly stuff and found racers at the moment right it said 141 am I've got myself a cup of coffee and I've booted up the little poly racer project again so let's get cracking at that one so my real project is a little bit ahead and you can actually play the game if you look in the description and you can actually play my version of the game it's got a little bit further ahead with some sounds and things like that and skid marks and things go to that URL and play it and I'm gonna have a little competition so whoever scores the fastest lap before first of June will win $50 on steam steam vouchers so how about that and you have to record it so I can see that it's happening so you have to record it maybe using OBS is that's what I use to record this stuff so it's called open broadcast software if you google lot you can download it and do a screen capture post it on on YouTube and whoever's got the fastest lap and you have to let me know about it as well hashtag it's low poly racing so maybe I can find it that way and yeah I'll check out whoever before the first of June midnight CET and will win $50 in the steam vouchers how about that all right guys this is where we left off pretty much anyway I've got I just continued to place all the trackside objects so I added there more stones more tires and more fences all the way around the track but it's pretty much exactly how I did it in episode 4 so have a look at that if you want to see how to place those trees and and trackside objects and then I swap through the cop car out for this race car I also model this one during this 10 minute video if you remember that so I've swapped that out so I thought it was a little bit more racy to keep that one in the game so but it's pretty much the exact same setup as before it's here it's just got the same hierarchy for the wheels and everything like that that we did last time and if I press play now there's no mmm yeah pretty much where we left off anyway so so the first thing I want to do now is I want to create a prefab out of this one so I'm gonna just create a folder here called prefabs and another subfolder here called cars so I'm gonna drag this racy car now and I'm gonna drag it into the cars subfolder and just by doing that it'll create this little blue icon here and that makes this one blue as well it's created a prefab out of it a prefabricated object that you can reuse over and over again I think next thing we're gonna do now is well I want to branch out a little bit with the scripts for the game manager and I want to create well have to keep track of lap times and things like that so I'm gonna create a player object so in this folder in the scripts folder right click and do creates a c-sharp script and let's call this one player and then double click to go into edit this one and now we're gonna start adding some content here stuff that we want to have the control over so the car is the car itself I want to try to isolate the logic as much as possible so when I create the scripts and components for example the car should really focus only on what the car is doing so like you're keeping track of the wheels and applying torque to the wheels and doing skid marks and things like that so I want to branch out now a little bit and make a player prepare sorry I play your script that does some stuff so the first thing I want to make possible is I want to create a public enum here called control type and that's gonna be able to have two different values one of them is human input and the other one is AI because a player could either be me playing the game using my keyboard or a controller or it could be an AI player fill both of them are players just once human and once AI and I just want to set up so I can prepare for that in the future when we added some AI stuff and then we want to do a public control type here of that enum type and it will name it control type and set that default to human inputs and that's why we will be using Ned Ned we want to keep track of a few things we're going to start adding some lap times and things like that so let's do some public floats here as well and floats is basically I'm just gonna keep track of the number of seconds that are lapped it takes and then we can reformat that into a time format let's make a property here called best lap time and it's gonna be a property and we're gonna be it's a public get so we can get it from anywhere any script will be able to read this one but only this one was separate so we're gonna say private here set and then we're going to default it to math F dot infinity because we don't really have a best lap yet and if we set it as zero and we try to compare a lifetime to zero you're never going to be 0 or yet so let's just set it to infinity every one would be to infinity so this second float will do as well it's public floats and there let's do last lap time because we want to keep track of the most or the previous lap that you just completed and that one we can set to zero but it's not being completed yet so it's just for time and then we're gonna make another one let's do current lap time so current lap time this is also gonna be against from anywhere but private the steps and default down to zero as well and then we have a lap counter as well so we'll do a public int integer this time whole numbers and there's gonna be current black gets private sets and equal zero that's it and then we have to keep track of some of the timers as well so those are just to keep track of the of the actual lap times themselves and the current lap count but we have to use a timer to time ourselves as well so what we'll do here is we'll do a private floats lap timer and we also need to cap create some checkpoints to pass and we have to keep track of those so let's do a private into let's just count those last checkpoint pasts set down to zero so I have the scene here let's just start by in all the corners will create a trigger Collider so I will start I think by the start finishing line here so if I go here and let's create a new folder here on their track let's just create a new empty game object and call it the check points check points no we keep that at zero zero zero here and then we add our first check point so I'm gonna click Add here and create another empty and then just call this one one short short and sweet and no need to complicate it and then we add a component here and it's just gonna be a box Collider and it's gonna be a trigger so we take this little trigger mark here and then we can change the size let's see if we can find it in the scene here now we'll just move the whole game object here so we can get this into place so I'll zoom out a little bit on the mouse wheel here slide it into here and now let's just create a quite a generous Collider here so we'll make it wider like this let's make it possible to pass a little bit on the grass here as well and then maybe we change the heights as well in case your or no the depth to cover you have attractive and then height as well maybe someone's flying through here colliding on something so let's be generous on the height is on the height as well so this is going to be our start finishing checkpoint one collider and then what I can do is just a select this one and press control D to duplicate it rename this one to two and then let's just put colliders here on each corner so I'm gonna slide it here so I so top of you that's it and now we select third to here now we know that they're perfectly aligned with the isometric view and we've got a perfect to top view by clicking on this little green axis here the y-axis then we know that this is looking straight down it'll be a little easier to align these now we can plus less press select this one again press e to rotate not like blender so where it's are here it's e so let's rotate it into shape and press R to scale very strange let's just make a checkpoint here again a little bit generous on the grass so you don't have to do it perfect maybe you can cut the corner slightly there let's press control-d duplicates I'll rename all of them later on so let's just put keep putting these now and rotating them putting them into the corners here control D again rotates [Music] it's a bit tricky for the player to know now if they've passed the checkpoint or not they'll just be disappointed if they come through a lap and it doesn't count they shouldn't have skipped the corner than should be so should be alright but you could the consider maybe putting some little things that light up like little lights that shows that you've cleared the checkpoints that's one way to do it maybe so I'm just doing ctrl D rotating these into place for all the all the corners here and there's no back or front on these there they just have to be there so you can pass through them ctrl D oh this is gonna be just two more out so rotate this one bring it down to there and control D like not the same shape and now we'll just just do a whole bunch of f2 on these to rename them 5 6 7 8 5 6 7 8 9 10 and 11 also what I'll do is I'll create a new layer for this now we can go back into perspective here and if I block select this will shift up I'll see all the colliders here that I've got that looking pretty good so go here on the layer add a layer let's call it checkpoint and then I go again block select all of these actually let's do the whole thing here checkpoint and then yes to change all the children so okay so now we've got a whole bar should check points here now we need to make sure that the car is passing through these and we were working on a script for that so we've got this player script now it's not attached to anything it's not actually doing anything yet so let's work a little bit more on the script so first thing in the awake we're gonna use the awake instead I usually use a way to get things you don't know what awaked us it's a money behavior that executes automatically and so does start but all the awake so if I do this avoid awake any script now in unity that has this awake method will be called as soon as the script is awoken or it started up and then it will complete this awake on all of the different scripts that you have all the morning behaviors and when it's done with that it'll actually do the start method on all the scripts and then it will complete that and then it starts going into its update loop so you can you have a little bit of control if you want to put it in a wake or a starch so sometimes you can have a race condition so you want to if you have something that must be set in start you can set it in a week that was a long a lot of that chatting there for very little information but in their wake anyway so when this game object is started we want to do checkpoint parent we need to find this parent object checkpoints it's plural parents and let's just do a quick endure key find for this one game object find checkpoints pop transform we want the transform for this one and we actually have to define that one here so we need private transform checkpoint parent okay and so game object dot find will unity will look in the entire scene now for a game object that's named checkpoints and it goes by this string here this will look through the entire scene and this is quite an expensive operation for unity to do to look through the whole hierarchy you don't want to do this in every frame of your game but I'd say it's perfectly fine to do it in awake so sometimes it's difficult to if you rename the object and you seen for example this won't be found and over the federal an error and I'd also say that it's pretty good that the game throws an error so don't do a check here to say if no then just be silent it's good that it fails if you change the name because then you know oh yeah I have to change the name the reason why I'm not doing it into a public one here and assigning it in the inspector it's because I have loads of tracks let's say I've created ten tracks I don't really want to be creating a hard reference here in the inspector for each track because this should be quite generic the script so it should just expect that there is a checkpoints parent somewhere in the scene and use that one that's why I'm not using public to expose it in the inspector so now that we've got that let's do a checkpoint count as well so checkpoint count equals checkpoints parents doctor child count every transforming unity you can access this little property or a variable called child count and this one we haven't defined yet and there's a nifty trick in se visual studio that you can do I just typed the name that I wanted here you can press control period on your key and then it the first suggestion here is to generate a field and if I just press enter now you don't have to type this manually every time so that's quite a nice trick to save yourself some time so now we've got a track of how many and we created eleven checkpoints so that's what's going to be it's going to detect now if we look in the unity here now we can see that the checkpoint has got this is a transform if you remember and it's got eleven transform under it the children and that's what it finds here so that's kind of turn into eleven then we'll do a checkpoints layer let's see checkpoint layer equals layer mask and here at this layer mask name to layer and we're going to convert the check points layer here and then again we want to define this one control period and it will know that you should generate and this is an integer and the reason why I'm doing this is because it's faster for unity to run on integers instead of having to do a name check all the time so that's why I'm defining it in a week it only needs to convert layer mask button name to layer we'll take this string name and convert it to an int it could be some really weird number that only unity knows about but it stores it in this layer so we can use that one and finally let's we need to get a hold of the car as well so let's do car controller so this is for the player equals get components and we'll get the car controller component and we have to generate this one as well so stand here control period enter and that's defined those for us because we need to keep track of a few things for the car as well the reason why we want to keep track of the car as well here is because we're going to send the inputs here we're feeding the input controller but we're going to change this now so either an AI or a human can control this car I'm going to change this around now and have the player script to take care of this instead so let's actually just copy this now control C or control X actually to cut it out and then let's go to the Play apps script here delete this goal and now we'll do if control type equals equals equals remember it's two equal signs here doctor human inputs so if it's human input so now we need to change because these are actually properties that exist on the car controller and we've defined the car controller here so we can copy this control C control V control V so now we've just moved this logic from the car script from the car controller into the player controller so now if we're human most of us are not everyone I doubt myself sometimes if you're human it'll take your input and it'll throw it to the car so same as we did before now actually if we put this script on the car itself now we can still have the car and we can even though it's called player we can still have the script here so we've got the car controller now let's just drag the player here if I press play now it should find the car controller yeah everything works again we're still not actually doing anything about the checkpoints so let's fix that now all the the only thing we did know is we've separated some of the logic into this player script and we're human area if I switch this to AI now I haven't implemented any AI so nothing will happen why is that working I haven't saved this one yet so I have to save it let's double check this dong this shouldn't work now so the the car controller doesn't have any any input so it I hit W like a crazy person nothing happens let's switch it back to human input forward and then here we go now it's the player script that listens for the keyboard input it for human and it sends it to the car controller so that's good now let's start doing some lap times counting here so we can do let's go back into the scripts the player now let's start to check in the last time a little bit so let's do current lap time equals lap timer I would define the lap timer yeah there we go and if that's greater than zero that means that we've actually started the lap timer and then we're gonna have it set to time that's time - luck timer or otherwise it's going to be zero so this is just a shorthand if statement here to not break it out over a loads of lines but current left time will if a lap timer is greater than zero then the current lifetime will be time current time and unity - the lap timer which is basically like a time stamp otherwise it'll stay zero so if that makes no sense look we need to add a little bit more code for this to work so let's create another one here called it's gonna be a new method void start luck and here we do we'll increment the current left so currently plus plus means that it's just kind of added by one that means that we've created a or we've added a new luck we completed a lot we have to reset the last checkpoint passed to number one because this is going to be called when we pass the start/finish line so that means we've checked the Lib we've passed a checkpoint one here and also let's set a lap timer here so lap timer equals time dot time and what we're doing here now is we're just putting when you press play on a game in unity then it starts from zero this time dr. time and for every second I'll just count up but it's also a float number so it'll have quite good precision with milliseconds and things like that so what we're doing here when we start a lap we're basically setting a time stamp here and what you could say that for example if if you pass this when the clock is at seven let's see 7.87 why did I write seven seven five but let's say it's 775 years they'll just take the current time and store that in lap timer and the reason we do that is because here in update when we if the current lap time we can actually calculate so let's say now here the time is we've driven past the first corner and coming up to the second maybe that took us about three seconds so now the timer is time what I my points into the screen so time that I'm here now is ten point seventy five say and we do - 775 because that's what this timestamp is and we could actually rename this one and call if I press F to go I can rename it to luck timer time stamp and that would be equal to three seconds so the current lap time is up to three them so that was a little brief explanation of the logic totally makes sense and we also need to do an end lap here so we'll do void and luck so these are methods that we can call and then we're actually going to calculate now what the last lap time was so let's do last lap time equals current time which is climbed up time - luck primer which is the timestamp so now we've completed all up and let's say that took about 20 seconds so again if the if the lap timer was 775 I renamed that one day timer time stop so if that one was 775 and we were now at 37 points 75 so that - that one meant that we did a lap about 20 seconds that's right isn't it yeah hope so laughs it was never my strong side so also we can do a best lap time checkers on best lap time equals math F dot min which is kind of pick the lowest of all you know of either love time or best lap time and the first time we complete the lap here let's say it took you one minute because you don't understand how to drive a car and this will check it is one minute lower than math F infinity and it's gonna say yes and then it's going to store in best lap time it's gonna store that one minute lock but next time you come around maybe you did it in 40 seconds because you've improved a little bit then it'll see okay forty seconds is lower than the current or the last best lap time that I have of one minute so I'll store that one it'll keep doing that all the time and update this best lap but then again if you did a slower lap then it won't update it because it'll take the smallest value of either the current lap family or the last lap time you know you did or the best lap time still nothing would really happen we just prepared a lot of things but now we need to start checking for the collisions here so on the play you skipped here let's do void on trigger enter and then button this is a Moni behavior as well that in unity will execute when it hits a Collider or a trigger in this case and we can actually get some information about the collider so you can do this when we drive our lap now you enter one of these triggers this will be called automatically on the script since we've triggered it and now we need to do some logic in here if let's say if the collider game object layer is not a checkpoint layer checkpoint layer then we don't want to do anything so we just return back we want to ignore that let's say you had another trigger here for a red light or something like that I don't know any trigger then we want to check here that it's actually a checkpoint later and if it's not the checkpoint layer the Collider that we just entered the trigger of we want to just return out of this we want to ignore everything else so we know now if we hit this line down here that means that we have in fact entered a trigger or the checkpoint that is so if Collider game object now we can check if that trigger name is one because that's what we named this object too if you remember we just named it short and sweet one here so I'll check if this name is one that means that we're actually passing this checkpoint here and then we can do some logic here so let's enter some squiggly marks here and then we'll do if last checkpoint paths equals checkpoint count if the last checkpoint that we passed was the same as the checkpoint count which is number 11 that means we've just completed the lap because we hit the last checkpoint the comment is to make a bit more sense so if this is checkpoint 1 which is we're doing the check here now we're going to see and with completed a lap and the current block so that means that if the last checkpoint that we passed equalled checkpoint count so if the last one we checked was this one and you're now hitting this one that means we've just completed a lap so we can do and lap here and then we can do if actually let's put some commas here again so let's do if we are on our first lap or we pass the last checkpoint so currently equals 0 or if last checkpoint busts what's the checkpoint count that means that we need to starch lap here if we are just about to start our first lap here then if Curt lap is zero we haven't done a lot then it doesn't matter as long as you the start/finish line we're gonna start a new lap what if you drove and tried to cheat so let's say drove the car here passed checkpoint 1 passed checkpoint to checkpoint 3 passed checkpoint 4 here passed checkpoint five you thought huh I know a shortcut so I'm just gonna cut across the grass here and try to complete the lap that won't work because with this check here now we need to see that it's either so you're on your first lap so then this won't be true then it's gonna see ok last checkpoint passed it was number 5 it wasn't number 11 but it needs to be so we're not gonna start a new life we know you cheated also we did we know that you didn't finish this luck because it needs to be 11 there that's it we can just return we're done they're in the script but there's also if it wasn't number one here that you hit we want to do some more checks as well so let's put some logic here so if we've passed the next check with the points in the sequence because we have to do them in order as well we don't want to be able to do like a checkpoint one and I skip across to number five and then find an optimum route like that so let's do update the latest checkpoint and we do that through if Collider game object name equals lusts checkpoint pasts plus one and this is an integer so we have to convert this to a string this method a then we can do last checkpoint passed plus plus and this means that the the name of the checkpoint that they passing needs to be one named one number higher than the one that you passed previously and only then should you increase the last checkpoint passed so you can't just one other one there that would have been ugly to do if you didn't do this check basically you could just drive across the finish line go back hit pretty much no this just this checkpoint again number 11 and then do another lap at a lower life that's what we need to keep track of the sequence we're pretty much done with this script now but nothing really happened because we're not updating a UI or anything so maybe we'll just the debug log some input here and say here what's in this method let's do deformed blonde start here we can do and laughs let's do a debug leg here and blah and then we can say lock time seconds now we can try this let's press play and we won't really know since we're not outputting you now we see yeah start luck that won't trigger time I looked down there so I crashed instead let's drive around a lap here it's clear this jump and let's see there M la 23 seconds and 58 parts of a second hundreds we might as well move the straight on to the UI now so we can actually I'll put this onto the screen for that will the create canvas so let's minimize this a little bit right click here and go create UI canvas and we can create right click UI panel and we don't really want it to be white so we can take away this just image just use to get rid of it remove and let's call this one panel or we can call it a race panel and now we need to throw some text at the top so let's just do right click here UI texts and let's make it yellow or orange let's type here luck and then put some placeholder stuff here and we don't want the luck looking for the wrong way we don't want the love to be in the center of the screen like that so first of all let's make a little bit bigger and bolder and then we want to put actually you can put some shadow on as well it's a bit difficult to see so let's add a component here just type in shadow and you can get a little shadow here maybe 2 minus 2 to get through offset a little bit more let's call this one texts current good luck and then we need to position this and this could be a bit tricky to before you get used to it but it's all about this rect transform up here and we're currently it's got a center point here and so wherever this position is and it's got pivot points of 0.5 0.5 which is in the middle of the object because it goes from zero is on the left of the object and zero is on the wise at the bottom of the object and then it goes up to one so what we want to do if we want to align it up in this corner here first of all we want to change this anchor here so it's anchored up in the top-left corner here and then we want to do the pivot point we don't want that to be in the center of the text so let's do that one to zero which is at the left of the texture and it's left aligned the texture as well and then we want to do pivot point is going to be wrong one on the y-axis because y1 is at the top I'll be here this one and now we can change this so if we put zero here it'll slide it all the way to the left edge here and then zero on the Y it'll slide it all the way up so I recap here we put the anchoring point here to top left and then we've put the pivot point to the top left of this text object here and then we've reset the position to zero zero and that that will nicely anchor this one now so regardless of how you resize this it'll put that up in the corner but then again we want to have some margin maybe so let's put it 10 pixels in and maybe minus 10 down or something like that and let's make it should we make a little bit bigger now I should be alright but what we'll do is we'll actually scale as canvas as well because if you resize this the text will be really small all the time so let's scale it to be to scale it with screen size now we'll always have the same it'll make the text bigger if you have a bigger screen so maybe that's quite suitable for this game so that's gonna be our lap timer we or sorry the luck count we want to have a lot of time as well so let's do another one here called current time and then we can we just press control D to copy that on now we can slide the exposition in a little bit maybe two there let's type a nice even number than 110 and then this was going to be like or just at the time and it's quite raised to have it in italic isn't it so let's do italic text for all of these it's a bit sporty race Cory old italic okay and here we're gonna have just it's gonna say like sometime here we'll just type in a place all this we know roughly how big it is now and then we need to do two more we want to keep track of the last lap time and also the best lap time so just press ctrl D to duplicate these the best one let's just keep slide these in actually you could react it to be a right line or something like that but let's just do this blast and also here the best let's slide this one into and I always like to keep this don't like not I'm a bit OCD so I need to have it on some beastly numbers thing did you round it off if I press play now this is not gonna update because all I've done is create some placeholders here so it'll be fun if this actually kept track of what we're doing and for that to tap and we need to create a new little manager here so let's create a new object here under the game manager create empty let's call it UI controller let's create a new script here right click undo c-sharp script UI controller let's drag this script on to the UI controlling game object and then we need to put some content in here as well here we want to keep track of a few things so the first thing we want to do is expose some stuff to the inspector so probably game object and it's going to be the UI race panel here that we want then we're going to keep track of these different text objects that we create so let's do public text UI text current lock was the first one and this one is squiggly red here because we need to do control period on it to a use using Unity engine docking UI then it knows what that it's a text object here that we want let's say ctrl C this one and do current time from here we want to change to last left time and then best lap time and if I go back here now it should expose these into the inspector here and now we can just drag these here so we'll drag the race panel to here because if we're in a menu we want to hide the race panel that's why we need to reference to that the current lap here there we go time last lap and best lap so now we've created references that's still not gonna update because we've only created a possibility to use these so and we actually have to say okay which player should we be updating as well so let's do a public player and then update UI for player and let's just make this a property that we can get from outside actually that's instead of making it properly now let's expose that in the inspector because we can script that later on but for now let's just do a reference to that in the inspector here so if I should pop up down here and then we just drag this the player script is on this racy car here so that's it and let's go back into the script again and in the update folder popped a folder in the update here now let's just check if there's actually an update player set and if it isn't then we just return out of this will turn there we go then we actually need to keep track of we don't want to be updating the UI all the time only when something is changed so let's do a private integer here called current block and then a private so let's just do all these private for the current current time I'll do lust and one more here called time and ice only change these if they've actually changed let's do a check here if currents okay if update UI for player dot current lap isn't the same as the current lap that we've actually got stored or in our private variable then we need to do something we need to do let's update the UI so current block needs to be set to the update UI current so we'll get the current lot from this player and store that in our private variable and now we need to update the UI as well so UI texts current lap dot text equals we can do a dollar sign before a string here then you can do some inline string replacement here so let's do locked hole on current luck with these squiggly marks then that'll replace it allow you to insert that into the string so this should work now if we go over to press play bring luck one and then the reason why it starts on xxx because we haven't stored anything what we could force it and to change that because we're on basically on lappa zero so if we cut laughs equals minus one here just to set set it to something so it detects that it's different here now when we press play a lot they thaw straight away to number zero and then we do a lap here and there we go what one okay let's fix the times as well no so we do another one here if let's copy this because we're going to be typing it sometime you copy so if the current lap time isn't the same as that what we've stored here a lot per minute locally then we'll do current lap time yeah sorry current time equals current or we call that a lifetime so let's actually do that here is one f2 to rename that one and then we'll do here UI text currents time of text equals and then time okay so here for time we'll do first we need to get the minutes of the we don't want it to be we want to break out the minutes first of all here so let's do this quickly here to replace the text in you will cast it to an integer and we'll do the current lap time divide that one by 60 to divide it by 60 seconds but we'll just keep the whole whole number from this the integer we'll put a colon here and then we'll do another now I'm gonna get the seconds and the hundred thousands of a second here so we'll do current lap time and then we'll do modulus 60 so we get rid of the minutes first and then we do call in the format for this this is how you do this string format it's going to be seconds two seconds here so it'll start like zero one zero two zero three and then it will keep 300 thousands of a second here is well now we press play when we pass this it'll start counting the lap timing here okay we need to just do the same now for the last and the bests update here so let's copy smoked these copy them and then here we'll change it to [Music] oh yeah we need to change this as well so this can't be the current time so I need to be visiting UI text element for last time last lap time and best lap time and then we change here to lust and here to best and let's plate okay we've got an issue here with bestest not a number none so you need to get rid of none we have to implement a little overflow exception for that one so what we can do here is let's only update this one if we've actually set a decent lap time so the best laughter if it's these if I don't know but let's say it's less than a million at least so it's not infinite you've done a terrible up if you're on there this is the shortcut for a if statement so if best lap time is less than him let's see a million then after this question mark it'll put this text here and there will be a colon here and then otherwise none let's just put because you haven't raced yet so now we'll try again and plate so here we go let's try see if this works now as well so we've got our timer it running we're on lap number one steer here a bit and let's share the jump and now we should get last lifetime you and we should go up so lap is now - timer reset and we've got a last lap time of 21 5 20 that's good so that one worked and now we're gonna see if best lap is shouldn't update now because there is lot is not so good so let's see let's actually complete it oh no we can see that it didn't update the best lap time that last shoe still update there we go so last lap time and now we're okay so one more thing we can do we can make this persistent as well [Music]
Info
Channel: Imphenzia
Views: 61,022
Rating: undefined out of 5
Keywords: low poly, racing, unity3d, racing game, top down, super cars 2, lap times, checkpoints, ontriggerenter, ui, canvas, lap timer, imphenzia, how to make a racing game, blender
Id: h-sEtELln9k
Channel Id: undefined
Length: 42min 26sec (2546 seconds)
Published: Mon May 18 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.