P4U Requirements

Setting up P4 server

Setting up Unity3D

Setting up P4 client

Installing P4U

Setting Up P4U

Introduction to P4U


P4U Requirements

P4U has been tested with Unity Pro 3.3.0, 3.4.2f3, 3.5.0f1 and Perforce server 9.2 – 11.1. We cannot guarantee compatibility on other versions of Unity3D or Perforce.

Microsoft Visual C++ 2010 Redistributable Package (x86) installed.


Setting up P4 Server

Please refer to Perforce’s install and admin documentation for full docs



Quick install OSX:

Scripts and docs credit: http://www.piap.com/faq/p4_setup.html

create a user named admin in System Preferences: Accounts

download p4d from perforce

make a folder in the users folder (admin) named perforceServer

create the following folders within perforceServer







Copy the downloaded p4d into bin

Download the p4d scripts Perforce OSX launch scripts and unzip them into the scripts folder.

Edit p4d.sh edit the line “-p \” to match the IP of your server and change the default port of 1666.


if you have a Perforce license file copy it into “p4droot”.


You can set the “Start P4 Server” script to run at login on your server or set it in cron.

Also you can use the “Create P4 Checkpoint to create your perforce backups and journals and attach it to a cron every day.

We suggest using Cronnix to modify your cron settings. Match the following picture to set perforce server to create a checkpoint at midnight every weekday.


After installing and starting P4D (Server) test your connection

download p4 and copy it to a local directory

open a terminal or cmd browse to the folder containing the downloaded p4

type: ./p4 -p [server ip]:[server port] info



If connected properly you should get the following


User name:

Client name:

Client host:

Client unknown.

Current directory:

Client address:

Server address:

Server root:

Server date:

Server uptime:

Server version:

Server license:

Case Handling:


Reference: http://www.perforce.com/perforce/r10.1/manuals/p4eclipse/topics/filetypes.html


Make sure only one person can check out binary files

+l: Exclusive open (locking). If set, only one user at a time will be able to open a file for editing. Useful for binary file types, which cannot be merged.


Unity requires local files to be writeable

+w: File is always writable in workspace. (Perforce manages the write bit, and files that are not checked out are, by default, not writable.)

type the following into command line:

p4 -P [password] -u [user] -p [server ip]:[server port] typemap


This will open a text file that looks like the following:

add the following  under TypeMap:
binary+lw //….prefab
binary+lw //….mb
binary+lw //….mat
text+w //….meta
binary+lw //….psb
binary+lw //….mp3
binary+lw //….fbx
binary+lw //….unity
text+w //….js
text+w //….cs
text+w //…shader
binary+lw //….asset
text+lw //….cm
text+lw //….proc
text+lw //….md5mesh
text+lw //….md5anim
text+lw //….ma
binary+lw //….aas
binary+lw //….tga
binary+lw //….jpg
binary+lw //….lwo
binary+lw //….wav
binary+lw //….ogg
binary+lw //….demo
binary+lw //….roq
binary+lw //….doc
binary+lw //….xls
binary+lw //….celtx
binary+lw //….pdf
binary+lw //….odt
binary+lw //….ods
binary+lw //….ppt
binary+lw //….skp
binary+lwS //….dds
binary+lwS //….bnk
binary+lwS //….light
binary+lwS //….shadow
binary+lwS //….ibl
binary+lwS //….bik
binary+lwS //….upk
binary+w //….dll
binary+w //….exe
binary+w //….response
binary+w //….lib
binary+w //….pdb
binary+w //….u
binary+w //….ini
binary+w //….stub
binary+w //….ip



Save and quit text editor. The terminal will now show typemaps updated.


Setting up Unity3D


Open Unity3D 3.3.0

Create a new unity project at the same directory as your P4 client root named Unity.

ex. /Users/ariel/Projects/ATAL_BulleTrain/Unity

Open Editor Settings

Enable Version Control Support

Quit Unity3D



Setting Up P4 client

This step is required to not sync or submit the temp folder and most of the library folder. The only files we sync from the library are the project config files. All databases are recreated using metadata files locally for each client.

Open P4V on your local computer and create a new workspace for the computer.

Edit your workspace view to match the following


Replace “[Depot]” with the name of your depot.

Replace “[Client Workspace]” with the name of your workspace.


//[Depot]/… //[Client Workspace]/…

-//[Depot]/Unity/Library/… //[Client Workspace]/Unity/Library/…

//[Depot]/Unity/Library/EditorBuildSettings.asset… //[Client Workspace]/Unity/Library/EditorBuildSettings.asset…

//[Depot]/Unity/Library/InputManager.asset… //[Client Workspace]/Unity/Library/InputManager.asset…

//[Depot]/Unity/Library/ProjectSettings.asset… //[Client Workspace]/Unity/Library/ProjectSettings.asset…

//[Depot]/Unity/Library/QualitySettings.asset… //[Client Workspace]/Unity/Library/QualitySettings.asset…

//[Depot]/Unity/Library/TagManager.asset… //[Client Workspace]/Unity/Library/TagManager.asset…

//[Depot]/Unity/Library/TimeManager.asset… //[Client Workspace]/Unity/Library/TimeManager.asset…

//[Depot]/Unity/Library/AudioManager.asset… //[Client Workspace]/Unity/Library/AudioManager.asset…

//[Depot]/Unity/Library/DynamicsManager.asset… //[Client Workspace]/Unity/Library/DynamicsManager.asset…

//[Depot]/Unity/Library/NetworkManager.asset… //[Client Workspace]/Unity/Library/NetworkManager.asset…

-//[Depot]/Unity/Temp/… //[Client Workspace]/Unity/Temp/…




Click apply and close the window.


Select Menu: Connection: Edit Current Workspace.

Click Advanced Tab and enable File Options: “Clobber: overwrite writeable workspace files when getting revisions”

Click ok



Select the Unity folder in workspace view and mark for Add


Submit your files by right clicking on your changelist and selecting Submit.


add a description and click submit



Installing P4U

Open Unity3D and select your recently created project

Import the P4U Package

Accept the install into your project by clicking the Import button.


Setting Up P4U


Open P4U Settings window


P4U will use your Perforce environment settings if you have set them. You can also manually set them for each Unity3D project which is the preferred method when working with multiple projects and perforce depots.


Server IP and Port: Enter the IP address and port of your perforce server. ex.

User Name: Enter your perforce user  (Owner) name

Client Workspace: Enter your perforce workspace name


Click Save Settings


Introduction to P4U


P4U consists of two main windows the Project View and The Submission window.


The Project Window allows you to see the Perforce status of all files in your unity project. It also provides a menu bar with buttons to Sync to Latest, Submit, Checkout Selected, Revert Selected and Revert All.

contextual menus, right mouse click or [Ctrl] left mouse click on mac,  allow you to sync, checkout, revert, mark for delete and submit individual files.


Submitting Files


When you select submit from the menu bar, P4U menu or contextual menu a new submission window appears. This window allows you to select which files to submit and provide a perforce changelist description.