Search Unity

[v2.0 soon] Racing Game Starter Kit - Easily create racing games!

Discussion in 'Assets and Asset Store' started by Ian094, Jun 30, 2015.

  1. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    Hi,

    Currently, the kit only supports single player but multi-player (both networked and split-screen) will definitely be added in future. At the moment, I can't give an exact date when these features will be available because there's many other things to work on before taking on multi-player.

    The kit is centered on single player game-play only but with some tweaks you can add split-screen support for your game. All code is considerably neat & commented to it shouldn't be very hard to extend.

    Considering that you already have a racing system working for your current game, I would recommend finishing it then possibly getting this kit for a traditional racer to save time & make things easier for you.

    Thanks for your interest!
     
  2. aaaaabbbbb

    aaaaabbbbb

    Joined:
    Feb 14, 2015
    Posts:
    17
    Hi ian

    thanks for great asset again again and again.

    if you dont mind when will you release a new update?

    because every update is better and better and BETTER.

    thanks in advance.
     
  3. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    Hi,

    The next version (v1.0.7) should be live in about the next 2 weeks. So far some of the changes are :

    - Option to save car as prefab in the car setup wizard
    - Option to set a time to countdown from when the race starts
    - Improved menu template (the menu will be much easier to use & understand)
    - Data loading now handled from the Race Manager

    I'm currently working on adding lots more new features for v1.0.7.

    I will keep everyone updated here.

    Thanks for your support!
     
  4. artosking

    artosking

    Joined:
    Jun 15, 2014
    Posts:
    5
    Hi Ian, great Asset, but i have problem - when i add Car Setup Wizard, and choose oponent (and do everything that is needed) and when i press Play, opponents gets strange physic reaction - on Play mode i look into the Scene mode, and their force (i don't know which one - but it's a yellow line) is under the wheel coliders.
     

    Attached Files:

  5. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    Hi,

    The yellow line is the ray that checks for the current ground surface.

    Please check your WheelColliders, I suppose that their radius is too large.

    Check out this video too :



    Let me know how it goes.
     
  6. chrisabranch

    chrisabranch

    Joined:
    Aug 15, 2014
    Posts:
    146
    how do i stop the opponent cars from randomly spawning? i don't wont duplicate racers
     
  7. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    Hi,

    At the moment, you can't. The AI you assign to the race manager will be spawned randomly.

    However, I will work on improving spawn options in the next update.

    Thanks.
     
  8. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    I've improved the spawn settings to avoid duplicate racers. Here's a quick look :

    WIP
    spawn settings.png
     
  9. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    Hi @chrisabranch ,

    The spawn options have been improved to resolve this issue. This feature will be included in the next version (v1.0.7)

    Here's a preview :

    newSpawnOptions.png
     
  10. chrisabranch

    chrisabranch

    Joined:
    Aug 15, 2014
    Posts:
    146
    do you have a release time frame for v1.0.7 and will it include RCC support?

    I'm using RCC with the kit now by adding "statistics" and "progress tracker " to my RCC cars.
    it kinda works, but messing some features using this method.
     
  11. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    v1.0.7 should be live in about a week.

    It may include RCC support - I'm actually working on completely separating the physics from the race system so that any other vehicle physics can work out of the box without any making tweaks to the racing system.

    Thanks.
     
  12. chrisabranch

    chrisabranch

    Joined:
    Aug 15, 2014
    Posts:
    146
    HI, i have a feature request, (or two) dead zone respawn triggers. and AI car chase (like hot pursuit style).
    Thanks
     
  13. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    Hey,

    These are cool features! I like the AI car chase. I'll look into adding them to the kit.

    v1.0.7
    is almost done so I don't think i'll be adding them in this version.

    Could you please elaborate on "dead zone respawn triggers", I'm not entirely sure what these are :confused:

    Thanks.
     
  14. chrisabranch

    chrisabranch

    Joined:
    Aug 15, 2014
    Posts:
    146
    a trigger that is the cars go's to a out of bounds area, it will respawn back to the road, kinda like your wrong way respawn but in a box collider (trigger) that can be placed anywere .

    Can you list the new features coming to be in 1.7 ? my project is past due and wondering if i should wait and upgrade are release it how it is.
     
  15. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    Okay, I'll look into this too.

    Here's the current change log for v1.0.7 :

     
  16. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    Hey everyone,

    v1.0.7 has been submitted and should be live in a few days.
     
  17. chrisabranch

    chrisabranch

    Joined:
    Aug 15, 2014
    Posts:
    146
    To anyone thinking about buying this kit. Do it !
    It's the best one on the asset store ( i have them all and only use this one).
     
    Ian094 likes this.
  18. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    Thanks for the support!
     
  19. chrisabranch

    chrisabranch

    Joined:
    Aug 15, 2014
    Posts:
    146
    Has anyone tested the kit in ver. 5.3 ?
     
  20. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    Running on Unity 5.3.0f4 (Win 64-bit) on Windows 8.1 PRO and no problems building and running the demo on windows standalone. It also plays the demo from the editor without any problems.

    When importing this asset into a brand new empty project I get these warnings.

    Assets/RacingGameStarterKit/Scripts/Misc/MenuScript.cs(357,21): warning CS0618: `UnityEngine.Application.LoadLevel(string)' is obsolete: `Use SceneManager.LoadScene'
    Assets/RacingGameStarterKit/Scripts/Race/System/RaceUI.cs(169,65): warning CS0618: `UnityEngine.Application.loadedLevelName' is obsolete: `Use SceneManager to determine what scenes have been loaded'
    Assets/RacingGameStarterKit/Scripts/Race/System/RaceUI.cs(170,99): warning CS0618: `UnityEngine.Application.loadedLevelName' is obsolete: `Use SceneManager to determine what scenes have been loaded'
    Assets/RacingGameStarterKit/Scripts/Race/System/RaceUI.cs(220,65): warning CS0618: `UnityEngine.Application.loadedLevelName' is obsolete: `Use SceneManager to determine what scenes have been loaded'
    Assets/RacingGameStarterKit/Scripts/Race/System/RaceUI.cs(221,99): warning CS0618: `UnityEngine.Application.loadedLevelName' is obsolete: `Use SceneManager to determine what scenes have been loaded'
    Assets/RacingGameStarterKit/Scripts/Race/System/RaceUI.cs(423,45): warning CS0618: `UnityEngine.Application.LoadLevel(string)' is obsolete: `Use SceneManager.LoadScene'
    Assets/RacingGameStarterKit/Scripts/Race/System/RaceUI.cs(447,51): warning CS0618: `UnityEngine.Application.loadedLevel' is obsolete: `Use SceneManager to determine what scenes have been loaded'
    Assets/RacingGameStarterKit/Scripts/Race/System/RaceUI.cs(447,29): warning CS0618: `UnityEngine.Application.LoadLevel(int)' is obsolete: `Use SceneManager.LoadScene'
    Assets/RacingGameStarterKit/Scripts/Race/System/RaceUI.cs(460,37): warning CS0618: `UnityEngine.Application.LoadLevel(string)' is obsolete: `Use SceneManager.LoadScene'
    Assets/RacingGameStarterKit/Scripts/Race/System/Statistics.cs(268,69): warning CS0618: `UnityEngine.Application.loadedLevelName' is obsolete: `Use SceneManager to determine what scenes have been loaded'
    Assets/RacingGameStarterKit/Scripts/Race/System/Statistics.cs(269,70): warning CS0618: `UnityEngine.Application.loadedLevelName' is obsolete: `Use SceneManager to determine what scenes have been loaded'
    Assets/RacingGameStarterKit/Scripts/Race/System/Statistics.cs(270,74): warning CS0618: `UnityEngine.Application.loadedLevelName' is obsolete: `Use SceneManager to determine what scenes have been loaded'
    Assets/RacingGameStarterKit/Scripts/Race/System/Statistics.cs(279,69): warning CS0618: `UnityEngine.Application.loadedLevelName' is obsolete: `Use SceneManager to determine what scenes have been loaded'
    Assets/RacingGameStarterKit/Scripts/Race/System/Statistics.cs(280,70): warning CS0618: `UnityEngine.Application.loadedLevelName' is obsolete: `Use SceneManager to determine what scenes have been loaded'
    Assets/RacingGameStarterKit/Scripts/Race/System/Statistics.cs(281,74): warning CS0618: `UnityEngine.Application.loadedLevelName' is obsolete: `Use SceneManager to determine what scenes have been loaded'
     
  21. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    I've seen that Unity depreciated scene related functions from the Application class in 5.3. It's a shame that there isn't any documentation on SceneManger yet but I'll look into making this kit compatible with 5.3 soon.

    Edit : SceneManager Documentation
     
    Last edited: Dec 10, 2015
  22. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    v1.0.7 is live.
     
  23. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    Other than that it seemed to be fine. I will try out your latest v1.0.7 version.
     
  24. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    With v1.0.7 (Running on Unity 5.3.0f4 (Win 64-bit) on Windows 8.1 PRO ) I get the following additional warnings when importing this asset:

    Assets/RacingGameStarterKit/Scripts/Vehicle/Car/Car_Controller.cs(520,149): warning CS0618: `UnityEngine.ParticleSystem.emissionRate' is obsolete: `emissionRate property is deprecated. Use emission.rate instead.'
    (Filename: Assets/RacingGameStarterKit/Scripts/Vehicle/Car/Car_Controller.cs Line: 520)

    Assets/RacingGameStarterKit/Scripts/Vehicle/Car/Car_Controller.cs(520,90): warning CS0618: `UnityEngine.ParticleSystem.emissionRate' is obsolete: `emissionRate property is deprecated. Use emission.rate instead.'
    (Filename: Assets/RacingGameStarterKit/Scripts/Vehicle/Car/Car_Controller.cs Line: 520)

    Assets/RacingGameStarterKit/Scripts/Vehicle/Car/Car_Controller.cs(534,149): warning CS0618: `UnityEngine.ParticleSystem.emissionRate' is obsolete: `emissionRate property is deprecated. Use emission.rate instead.'
    (Filename: Assets/RacingGameStarterKit/Scripts/Vehicle/Car/Car_Controller.cs Line: 534)

    Assets/RacingGameStarterKit/Scripts/Vehicle/Car/Car_Controller.cs(534,90): warning CS0618: `UnityEngine.ParticleSystem.emissionRate' is obsolete: `emissionRate property is deprecated. Use emission.rate instead.'
    (Filename: Assets/RacingGameStarterKit/Scripts/Vehicle/Car/Car_Controller.cs Line: 534)
     
  25. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    Thanks, I'll get Unity 5.3 and fix these issues.
     
  26. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    Sounds good. You can add my vote for local multi-player (split screen) and also the water craft (hydro thunder style) that was mentioned previously in this thread.
     
    Ian094 likes this.
  27. chrisabranch

    chrisabranch

    Joined:
    Aug 15, 2014
    Posts:
    146
    Hi,
    I'm using RCC for my player cars and on v 1.0.7 when my cars re-spawn / wrong way , they fall threw the ground.
    it worked in the last version , and it still works with the default system.
    Did something change in the re-spawning code

    update: playing around it was a easy fix, the collider need to be at same level as script :)
     
    Last edited: Dec 11, 2015
  28. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    Hi,

    Check that your race track's layer is set to the "Ground" layer.

    When car's repsawn, they go into an "IgnoreCollision" layer for a few seconds. This layer only collides with the "Ground" layer.

    Check out this short tutorial on how set up your layers & layer collision matrix :

     
  29. chrisabranch

    chrisabranch

    Joined:
    Aug 15, 2014
    Posts:
    146
    WOW, the best support ever!!!
    replied in less the 15 mins.

    Thank you :)
     
    Ian094 likes this.
  30. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    Hi everyone,

    If you are using Unity 5.3, you'll get the warnings listed below :

    To fix these warnings :

    • Open the MenuScript.cs, RaceUI.cs & Statistics.cs

    • Add the UnityEngine.SceneManagement namespace :
    Code (CSharp):
    1. using UnityEngine.SceneManagement;
    • Search "Application.LoadLevel" and replace all results with :
    Code (CSharp):
    1. SceneManager.LoadScene
    • Search "Application.LoadLevel(Application.loadedLevel);" and replace the result with :
    Code (CSharp):
    1. SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
    • Search "Application.loadedLevelName" and replace all results with :
    Code (CSharp):
    1. SceneManager.GetActiveScene().name
    You will still get some warnings from Car_Controller.cs. I'm still trying to figure out the new scripted particle emission so you can ignore these warnings for now - everything will still work as normal.

    Thanks.
     
  31. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    Any plans on changing the minimum Unity version to 5.3?
     
  32. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    Yes, possibly in the next version.
     
  33. chrisabranch

    chrisabranch

    Joined:
    Aug 15, 2014
    Posts:
    146
    hi everyone,
    can someone guide me in the right direction? i need to make a button or trigger that will make the car respawn back to the nearest spawn point if the car gets stuck, i know the code is there(wrong way re spawn), i just don't understand how to use it as a UGUI button or trigger.

    i'm still in the prosses of learning C# :)
     
  34. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    Hi,

    The MobileUI prefab actually already has a respawn UI button. However, this only works when using PlayerControl.cs as input.

    So, to add a UI button that does this :

    1) Create a new script, name it appropriately and attach it to your player vehicle

    2) Add the UnityEngine.UI namespace and a respawn function that gets called when he button is pressed. The script should look like this :

    Code (CSharp):
    1. //namespace
    2. using UnityEngine.UI;
    3.  
    4. void Start(){
    5. //Find the respawn button
    6. if(GameObject.Find("RespawnButton"))
    7.    GameObject.Find("RespawnButton").GetComponent<Button>().onClick.AddListener(() => Respawn());
    8. }
    9.  
    10. //Handle respawn
    11. public void Respawn(){
    12. if(RaceManager.instance.raceStarted)
    13.    RaceManager.instance.RespawnRacer(transform,GetComponent<Statistics>().lastPassedNode,3.0f);
    14. }

    3) Ensure that your respawn UI button is named "RespawnButton"

    Whenever you press the button, the player vehicle should respawn at the last passed path node.

    To use a trigger, you'd simply need to add an OnTriggerEnter function and call Respawn() within it.

    Let me know how it goes.

    Thanks
     
  35. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    Ian094 likes this.
  36. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
  37. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    To resolve the Car_Controller warnings in Unity 5.3 :

    Go to line 522 and replace with the following :

    Code (CSharp):
    1.  if (p.GetComponent<ParticleSystem>()){
    2.    var em = p.GetComponent<ParticleSystem>().emission;
    3.    var rate = new ParticleSystem.MinMaxCurve();
    4.    rate.constantMax = Mathf.Lerp(rate.constantMax, 50, Time.deltaTime * 10.0f);
    5.    em.rate = rate;
    6. }
    Next, go to line 540 and replace with the following :

    Code (CSharp):
    1. if (p.GetComponent<ParticleSystem>()){
    2.    var em = p.GetComponent<ParticleSystem>().emission;
    3.    var rate = new ParticleSystem.MinMaxCurve();
    4.    rate.constantMax = Mathf.Lerp(rate.constantMax, 0, Time.deltaTime * 10.0f);
    5.    em.rate = rate;
    6. }
     
  38. chrisabranch

    chrisabranch

    Joined:
    Aug 15, 2014
    Posts:
    146

    Thank you, works perfect!
     
  39. brucearp

    brucearp

    Joined:
    Sep 1, 2015
    Posts:
    1
    Hi, quick question, I assume I would be able to use tracks made in Track BuildR with your kit?

    Thanks!
    Bruce
     
  40. chrisabranch

    chrisabranch

    Joined:
    Aug 15, 2014
    Posts:
    146
    i'm using Track BuildR and easy roads V3 and it works perfect.
     
  41. chrisabranch

    chrisabranch

    Joined:
    Aug 15, 2014
    Posts:
    146
    Hi ,
    to activate my player car (RCC) after the count down , i added the following to the code:

    public void StartRace () {
    //enable cars to start racing
    GetComponent<RCCCarControllerV2>().enabled = true; // this is the line i added
    Car_Controller[] racers = GameObject.FindObjectsOfType(typeof(Car_Controller)) as Car_Controller[];
    foreach(Car_Controller go in racers){
    go.controllable = true;

    It doesn't work, can someone tell me what i'm doing wrong?
    i'm using RGSK for car AI and RCC for player car.
     
  42. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    It looks like Unity 5.3.1 is already out. :)

    What features are you planning in your next release of your Racing Game Starter Kit?
     
  43. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    Hi, set the 'canControl' bool to true on the player car rather than enabling the script :
    Code (CSharp):
    1. Statistics[] racers = GameObject.FindObjectsOfType(typeof(Statistics)) as Statistics[];
    2. foreach(Statistics go in racers){
    3. //Enable RCC Player    
    4. if(go.gameObject.GetComponent<RCCCarControllerV2>()){
    5. go.gameObjetct.GetComponent<RCCCarControllerV2>().canControl = true;
    6. }
    7. //Enable RGSK AI
    8. if(go.gameObject.GetComponent<Car_Controller>()){
    9. go.gameObject.GetComponent<CarController>().controllable= true;
    10. }
    11. }
    Remember to set 'canControl' in your player car's inspector to false.
     
    Last edited: Dec 21, 2015
  44. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    I'm planning on adding :

    - motorbike physics
    - ability to save / load ghost car data
    - possibly, a replay system

    and overall improvement of the kit.

    If you have any feature you'd want to see, just let me know :)
     
  45. Max1982

    Max1982

    Joined:
    Oct 16, 2014
    Posts:
    133
    Please do car color (or tuning) changing option. Maybe something like that
    [/IMG] I think that it will be good option to create new source folder with tuned cars.
     
    Last edited: Dec 21, 2015
  46. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    Cool, I'll include this feature in the next update :)
     
  47. aaaaabbbbb

    aaaaabbbbb

    Joined:
    Feb 14, 2015
    Posts:
    17
    Hi Ian and Hi everybody

    I want to ask one question to everybody

    i want to buy a track builder asset and i stuck between 2 assets "track buildr" and easy road pro

    which one should i prefer?

    and Ian , you are great developer you know.

    can you make some physics improvements for ramps?

    your car physics are amazing except ramps.

    thanks in advance.
     
  48. chrisabranch

    chrisabranch

    Joined:
    Aug 15, 2014
    Posts:
    146
    Hi, this is not the right forum for this topic, but easy roads V3.
    :)
     
  49. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    Rewired integration (https://www.assetstore.unity3d.com/en/#!/content/21676
     
  50. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    @Intense_Gamer94
    I did a quick attempt on Rewired 1.0.0.78U5 integration with Unity 5.3.1 (Win-64bit) and Racing Game Starter Kit 1.0.7a. No changes were made to fix warnings due to changes in Unity 5.3.1. So basically straight out of the box and took about 5 minutes.

    (a) Added Rewired Input Manager to the scene.

    Assets\RacingGameStarterKit\Scenes\Demo\F1\F1Race.unity

    Rewired Input Manager Setup:
    Settings: Left the default of raw input: Added the a check for Rewired to run in FixedUpdate in addition to Update loop.
    Players: Created Player0
    Actions: Created Actions: Vertical (axis), Horizontal (axis), Brake (axis), Nitro (button), Respawn (button)
    Joystick Maps: Mapped the Actions to the [T] Dual Analog Game Template
    Left Stick X = (action) Horizontal
    Left Stick Y = (action) Vertical
    Left Shoulder2 = (action) Brake
    Action Top Row1 = (action) Respawn

    Added the Joystick map to Player0.

    I made modifications to the file Assets\RacingGameStarterKit\Scripts\Vehicle\Car\PlayerControl.cs

    line numbers below are approximate:
    (line 6)
    Code (CSharp):
    1. using Rewired;
    (line 14) within public class PlayerControl : MonoBehaviour added
    Code (CSharp):
    1. public Rewired.Player Rewiredplayer;
    (line 29) within the awake function added
    Code (CSharp):
    1. Rewiredplayer = ReInput.players.GetPlayer(0);  // Rewired player 0
    (lines 89-96) within DesktopControl added Rewired versions and commented out Unity versions
    Code (CSharp):
    1.  
    2. // car_controller.steerInput = Mathf.Clamp(Input.GetAxis("Horizontal"),-1,1);
    3. car_controller.steerInput = Mathf.Clamp(Rewiredplayer.GetAxis("Horizontal"),-1,1);
    4. // Debug.Log("Rewired version" + Rewiredplayer.id.ToString());
    5. // car_controller.motorInput = Mathf.Clamp01(Input.GetAxis("Vertical"));
    6. car_controller.motorInput = Mathf.Clamp01(Rewiredplayer.GetAxis("Vertical"));
    7. // car_controller.brakeInput = Mathf.Clamp01(-Input.GetAxis("Vertical"));
    8. car_controller.brakeInput = Mathf.Clamp01(Rewiredplayer.GetAxis("Brake"));
    9.  
    also added a gamepad button support on the controller for respawning

    Code (CSharp):
    1.  
    2. if ( RaceManager.instance)
    3.   {
    4.  
    5.   if (Rewiredplayer.GetButtonDown("Respawn")) {
    6.   Respawn();
    7.   }
    8.  
    9.   if ( Mathf.Clamp01(Rewiredplayer.GetAxis("Respawn"))>0.0 ) {
    10.   Respawn();
    11.   }
    12.  

    }
     
    Last edited: Dec 29, 2015
    Ian094 likes this.