- Home /
finishing a race
we are developing a car race but we are new to unity and also to programming. could you please help us out with a code to finish the race? i tried using the code for timers and also using check points. but i am not successful. please help me out with a time based game. i'm using unity 3.6
Lucky you!! Unity3.6!!! Damn.
Well, I like to use box collider every where so place a collider at your finish line, and every time you enter the collider increase a lap variable for example. Then with a if statement check how many laps were done and if you race is 3 laps and lap==3 then you could launch end race screen.
And make sure your collider is set to IsTrigger or you might have a surprise
Answer by GravitySpec · Mar 08, 2012 at 07:17 PM
Greetings time traveler from the future, here in the present Unity 3.5 was recently released.
Seriously, it will be hard for you to find someone that will just hand you code to do something. I've felt like it would have been better to have code handed to me at times but things work out a lot better in the end when you figure out the problem yourself with a little bit of abstract guidance with some basic skills used.
If you are new to Unity 3D and programming in general, I highly recommend visiting Will Goldstone's site Unity3DStudent.com.
There are many videos there to help you get started. On the right side of the page you will see a section that says "Modules". Start with the Essentials section and work your way up.
From there, I would recommend the following videos related to your question:
[[Beginner] 01 - Basic Collision Detection][2]
[[Beginner] 02 - Detecting Input][3]
[[Beginner] 06 - Simple Timer][4]
[[Beginner] 13 - Trigger Collision Detection][5]
[2]: http://www.unity3dstudent.com/2010/07/beginner-b01-basic-collision-detection/
[3]: http://www.unity3dstudent.com/2010/07/beginner-b02-detecting-input/
[4]: http://www.unity3dstudent.com/2010/07/beginner-b06-simple-timer/
[5]: http://www.unity3dstudent.com/2010/07/beginner-b13-trigger-collision-detection/
Your answer
Follow this Question
Related Questions
Jump. Script. 1 Answer
A Car color Changer 0 Answers
how do you switch guns from single shot to full auto? 2 Answers
Shoot. Just Shoot 5 Answers
Help for muzzle flash script 1 Answer