PrestoPad Quick Start

Get up and running in minutes

Quick Start Guide

Prerequisites

Before you begin, ensure your Unity project meets these requirements:

Step 1: Import PrestoPad

  1. Import PrestoPad from the Unity Asset Store
  2. Wait for Unity to compile the scripts
  3. Verify that the com.unity.inputsystem package is installed in Package Manager

Step 2: Add PrestoPad to Your Scene

  1. Drag the PrestoPadManager prefab into your scene
    • Location: Assets/PrestoPad/Runtime/Prefabs/PrestoPadManager.prefab
  2. Drag the ConnectionDisplay prefab to show the QR code
    • Location: Assets/PrestoPad/Runtime/Prefabs/ConnectionDisplay.prefab
  3. Configure the server settings via the PrestoPadServerConfig asset
    • Location: Assets/PrestoPad/ScriptableObjects/PrestoPadServerConfig.asset

Step 3: Configure Server Settings

Select the PrestoPadServerConfig asset and adjust these settings:

Step 4: Set Up Input Actions

  1. Open your Input Actions asset (or create one via Assets > Create > Input Actions)
  2. Create actions for your game (Movement, Jump, Fire, etc.)
  3. Map your actions to work with the PrestoPadControllerDevice
    • The device appears as PrestoPad in the Input System
    • Available controls: ButtonA, ButtonB, ButtonX, ButtonY, StartButton, SelectButton, DPad, LeftStick
  4. You can use any control scheme naming you prefer (no specific scheme is required)

Step 5: Test the Connection

  1. Enter Play Mode in Unity
  2. A QR code is displayed by the ConnectionDisplay prefab
  3. Scan the QR code with a smartphone on the same network
  4. The controller interface loads automatically in the phone browser
  5. Press buttons on your phone - you should see input in the Unity Editor!

Basic Code Example

Here's a simple script to handle controller input:

using UnityEngine;
using UnityEngine.InputSystem;
using PrestoPad.Input;

public class PlayerController : MonoBehaviour
{
    private PrestoPadControllerDevice controller;

    void Start()
    {
        // Listen for controller connection
        InputSystem.onDeviceChange += OnDeviceChange;
    }

    void OnDeviceChange(InputDevice device, InputDeviceChange change)
    {
        if (device is PrestoPadControllerDevice pad)
        {
            if (change == InputDeviceChange.Added)
            {
                controller = pad;
                Debug.Log($"Controller {pad.ControllerId} connected!");
            }
        }
    }

    void Update()
    {
        if (controller == null) return;

        // Read button states
        if (controller.ButtonA.wasPressedThisFrame)
            Jump();

        // Read joystick
        Vector2 movement = controller.LeftStick.ReadValue();
        Move(movement);

        // Read D-Pad
        if (controller.DPad.up.isPressed)
            MoveUp();
    }

    void Jump() { /* Your jump logic */ }
    void Move(Vector2 direction) { /* Your movement logic */ }
    void MoveUp() { /* Your up movement logic */ }
}

Troubleshooting

QR Code Not Appearing

Phone Can't Connect

Windows Firewall (Unity Editor)

When testing in the Unity Editor, you may need to add a firewall rule:

  1. Open Windows Defender Firewall with Advanced Security
  2. Click Inbound RulesNew Rule
  3. Select Program → Browse to Unity.exe
  4. Select Allow the connection
  5. Name: "Unity Editor - PrestoPad" → Finish

Next Steps