Opening document…

The interface could not load. You can still read below. Retry

9 Debug Unity with Studio

After Chapter 8: Audition in Unity, connect Studio to Unity on the same computer and use Monitor to inspect the game's Action calls and speed variable.

Configure Communication in Unity#

  1. Return to Unity and confirm that you have exited Play mode.

  2. Choose Edit → Project Settings from the top menu to open the project settings window.

    image.png

  3. Find and expand Harken on the left, then click Communication.

    image.png

    Check or enter the settings below. Bind Address is fixed at 127.0.0.1; you do not need to enter it.

    Field

    Setting

    Bind Address

    Confirm 127.0.0.1 (local connection, read-only)

    Port

    0 (automatically assign the connection port)

    Auto Discover

    Checked

    Discovery Port

    0 (use the default discovery port)

    Application Name

    RollABall_Game

    The completed settings should look as shown below.

    image.png

  4. Once configured, close Project Settings.

  5. Click Play in Unity's top toolbar to run the game.

    The Play button in Unity's top toolbar
  6. Leave the game running, but do not move the ball yet.

Connect to the Game in Studio#

  1. In Harken Hub → Projects, find RollABall_Audio and click Open Project. (Skip this step if it is already open.)

    image.png

  2. Find the Remote Connect icon in the toolbar at the upper left of the Studio main window and click it to open the connection window.

    image.png
    image.png

  3. Find RollABall_Game in the list, click to select its row, then click Connect.

    image.png

  4. Wait until the status shows Connected to RollABall_Game at …, indicating a successful connection.

    image.png

Open Monitor and Start Remote Capture#

  1. Once connected, close Remote Connect and return to the Studio main window.

  2. Choose View → Monitor from Studio's menu bar to open the event window.

    image.png
    image.png

  3. Leave Monitor open. In the toolbar at the upper left of the Studio main window, find Start Capture beside Remote Connect and click it to begin capturing.

    image.png

  4. At the bottom of Monitor, confirm that Capturing and Remote: RollABall_Game appear.

    image.png

Return to Unity and Play the Game#

  1. Return to Unity and make sure the Game view is active.

    The Game tab and game view in Unity
  2. Use W/A/S/D or the arrow keys to move the ball from rest and accelerate. You should hear the rolling sound.

  3. Slow down and wait for the ball to stop completely. The rolling sound should stop.

  4. Move again and collect several pickups. Confirm that the count increases and you hear the pickup sounds.

    image.png

  5. Switch directly back to Studio to check the Action and variable records.

Check the Three Action Calls and Results#

In Monitor, set the type to Action, leave the level at All levels, and use Search to look up each of the three Actions in turn.

image.png
image.png

  1. Enter Play_SFX_Ball_Roll_Loop and inspect the Description column. Triggered indicates that the Action for starting the rolling sound was triggered.

    image.png

  2. Replace the search text with Stop_SFX_Ball_Roll_Loop and confirm that Triggered appears, indicating that the Action for stopping the rolling sound was triggered.

    image.png

  3. Replace the search text with Play_SFX_Ball_Pickup and confirm that Triggered appears, indicating that the pickup sound Action was triggered.

    image.png

Check BallSpeed Updates#

Change the type to Variable, replace the Action name in Search with BallSpeed, and inspect the Set to … records. Confirm that the written values change with speed within the 0–1 range.

image.png

End the Debugging Session#

  1. When you have finished checking, click Stop Capture in Studio's top toolbar.

    image.png

  2. Wait until the bottom of the window shows Stopped - Remote: RollABall_Game, then close the window.

    image.png

  3. Click Remote Connect in the toolbar to open the connection window.

    image.png
    image.png

  4. Click Disconnect and confirm that Disconnected appears at the lower left of the window. Studio is now disconnected from Unity.

    image.png
    image.png

  5. Finally, return to Unity and click the stop button in the top toolbar to exit Play mode.

    image.png

Continue to Chapter 10: Summary.