This document provides instructions for setting up version control in Unity using Perforce. It outlines the steps to initialize a new Unity project with Perforce, set up the Perforce client and workspace on the local machine, get changes from the repository, check out and edit files, resolve conflicts, submit changes, and lock files. Key aspects covered include naming the Unity project and workspace, specifying the stream to use in Perforce, and handling incoming changes, checkouts, reverts, submissions and locks when collaborating in Perforce.
3. SET-UP PERFORCE
• New Unity Project
• Name the project (to something else than new project)
• After set-up of Perforce, changing name is not easy
• 3D set-up
• Nothing extra in it
• Do not place the project to DropBox/OneDrive/etc. synced folder
• Delete scenes folder
• Create Editor folder
• Add NewPerforceWorkspace.cs (in Material folder on islearning) to Editor folder
5. SET-UP PERFORCE
• On MSWindows
• Search CMD
• Click CMD from the result list
• Write (on CMD)
• p4 login
• Write your password (1st time it is empty; perforce requires you to change it)
• NOTE login input does not echo what you write!
6. SET-UP PERFORCE
• Workspace name
• Left_behind_2019_your_name
• If you use multiple machines, each
needs to have an unique workspace.
Add A, B, and so to name
• Stream
• //level_design_2019/main
• P4 command
• Default is probably right, fix if you get
error about command
7. SET-UP PERFORCE
Host should be empty
Remove “no” from noallwrite and
noglobber so the line looks like above
Save and exit from text editor
Change to revert unchanged
8. SET-UP PERFORCE
• Edit->Project Settings
• Set version control mode to perforce
• If you do not get connected
automatically
• Hit connect
• With login error
• rewrite your password
• Hit connect
9. PERFORCE
Do not use Perforce client P4V
Unless you really know what you are doing
10. LEGEND ON UNITY
Asset is local only, will not be submitted
Perforce server has a newer version
Someone else has deleted the asset
Asset will vanish/turn to local with get
changes
Local file will be
submitted
You and some other edited the
asset
You have locked the asset
Somebody has locked the
asset
You have checked out this
Somobody checked out this
11. INCOMING
Change list
comes here
Get all changes
• Window -> Asset Management ->
Version Control
• Get all changes
• This can take time
• 1st get is a large one
• Use wired connection or go to some
other part of school
• If others are also doing get all changes
Change tab
19. RESOLVE CONFLICT
• If conflict is with your group’s assets
• Keep your version and overwrite the server one
• If conflict with other group’s or core assets
• Keep server version and overwrite your own version
21. SUBMIT DID NOT SUCCEED
You need to fix this before
continuing
• Open pending change
• Submit one by one
• Check log files to see what
was the issue
• Revert/resolve conflict
on the ones you
cannot submit
• If you submit again the
problem file, you get a
new change list
• After change is empty
remove it
22. LOCK
• Locks a file so that others cannot check it out
• Do not use
• Without a good reason
• Unity lock some files automatically
• E.g., Scenes
• If you have locked files when you stop working
• Submit, revert or unlock
• Leaving locked files when not around likely prevent/hinder others working