Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Karting microgame Ghost Driver Mod not working (on new 2020 microgame version)

Discussion in 'Getting Started' started by Darknight747, Aug 22, 2020.

?

Were you able to get the Ghost Driver mod working in latest (2020) version of Karting microgame?

  1. Yes

    0 vote(s)
    0.0%
  2. No

    6 vote(s)
    100.0%
  1. Darknight747

    Darknight747

    Joined:
    Aug 14, 2020
    Posts:
    5
    The Ghost Driver Mod in latest (Aug 2020) version of Unity Karting microgame is not working!

    The Ghost mod tutorial says to edit TrackManager.cs, but this file/script no longer exists in latest version of the Karting microgame (Aug 2020).
    Attempting to edit the TimeManager and GameFlowManager scripts in latest 2020 version instead, results in errors being thrown.

    Can anyone help get the Ghost mod working for latest Karting microgame version?
    Has anyone gotten it to work?
     
  2. Darknight747

    Darknight747

    Joined:
    Aug 14, 2020
    Posts:
    5
    OK, figured out the Ghost Driver mod in newest Karting microgame (Aug 2020)...

    You need to put the code inside the GameFlowManager.cs file (instead of TrackManager.cs which no longer exists), and make sure your GhostManager file is in the same folder as GameFlowManager.cs and TimeManager.cs (so put your GhostManager script file into Assets --> Karting --> Scripts).

    Also need to make sure your GhostManager script file name is the same as your actual Class definition (I called my Class "GhostManagerScript", and needed to make the file containing it also be called GhostManagerScript.cs).

    Instantiating an object of type GhostManager within GameFlowManager.cs will expose it in the Inspector, and will allow you to drag the GhostManager object from the Hierarchy right onto the placeholder in GameManager's Inspector (so it will match what the tutorial originally wanted).

    The following can be entered as the very first entry under GameFlowManager class definition:
    // ---------------------------------------------------------------------------------------------------------
    // Ghost Manager script variable added here into GameManager flow (ghost footage start and stop added below)
    [Header("Ghost Driver mod")]
    [Tooltip("Mod Script controlling the Ghost Driver goes here")]
    public GhostManagerScript ghostManagerItem;
    // ---------------------------------------------------------------------------------------------------------

    The following can be entered right under "m_TimeManager.StartRace();" in the void StartRace() routine:
    // -----------------------------------------------------------------------------------
    // Ghost Manager: Start recording and stop playing ghost kart footage at Start of Race
    ghostManagerItem.recording = true;
    ghostManagerItem.playing = false;
    // -----------------------------------------------------------------------------------

    And the following can be entered right under m_TimeManager.StopRace();" in the void EndGame(bool Win) routine:
    // ----------------------------------------------------------------------------------
    // Ghost Manager: Stop recording and start playing ghost kart footage at Stop of Race
    ghostManagerItem.recording = false;
    ghostManagerItem.playing = true;
    // ----------------------------------------------------------------------------------


    It creates a very cool "instant replay" feature of the Kart race you just ran, assuming you give it enough time to play out before the black transition screen is allowed to take over and dump you into next scene.
     
  3. faraanunity

    faraanunity

    Joined:
    Feb 8, 2023
    Posts:
    1
    Thank you
     
  4. RichAllen2023

    RichAllen2023

    Joined:
    Jul 19, 2016
    Posts:
    1,026
    I managed to do the whole project this week in the 2021.3.15f1 version.

    Might be worth upgrading.