Category Archives: Unity 3D Scripts

Debugowanie gry w Unity3D z MonoDevelop\Game Debugging in Unity3D with MonoDevelop

Debugowanie gry w Unity3D z MonoDevelop\Game Debugging in Unity3D with MonoDevelop

In Polish:

1/ Uruchomione Unity3D i MonoDevelop

2/wstawienie pułapek (breakpoints) do kodu w MonoDevelop, w miejscu, gdzie podejrzewamy buga

3/ MonoDevelop: Run -> Attach to Process

4/ Pojawia się okno wyboru procesów do dodania

5/ Klikamy proces naszego Unity3D -> Attach

6/ Teraz Unity debugger jest dołączony do MonoDevelop

7/ Klikamy Play w Unity3D

8/ Kiedy dojdzie wykonanie programu gry do pułapki, następuje przerwanie gry (w pułapce strzałka)

9/ Teraz możemy stosować step over, step into i step out

In English:

1/ Start Unity3D and MonoDevelop

2/Insert breakpoints you want

3/ MonoDevelop: Run -> Attach to Process

4/ We see the window with processes to add

5/ Click the process for Unity3D -> Attach

6/ Now Unity Debugger is attached to MonoDevelop

7/ Click Play in Unity3D

8/ When the game runs a breakpoint, the game is paused (you can see an arrow in the breakpoint)

9/ Now you can use step over, step into and step out just like in other IDEs

An “ApplicationException: Unable to find a suitable compiler” Error in Unity3D

An “ApplicationException: Unable to find a suitable compiler” Error in Unity3D

When we try to manipulate our assets, we can get the error:

ApplicationException: Unable to find a suitable compiler

UnityEditor.Scripting.ScriptCompilers.CreateCompilerInstance (MonoIsland island, Boolean buildingForEditor, BuildTarget targetPlatform) (at C:/BuildAgent/work/xxxxxxxxxxxxxxxx/Editor/Mono/Scripting/ScriptCompilers.cs:XX)

And you can’t run “Play” button.

Of course, we can use

Assets -> Reimport All

But does it help you every time you run this command? You wait, wait, and wait for the end of importing. And always the same! You see the error.

I got the error too. And I started to search the problem in my assets. And now I know that if you see such an error, just look into your Assets folder in your Unity project. Remember:

No libraries (that are .dll files in Windows) should be in the Assets folder!!!

And you should remove all directories that contain libraries from the Assets folder. It’s the problem that cause this error. All the libraries must be outside this folder. It’s only for assets.

How to Setup Notepad++ for Unity3D on Linux

How to Setup Notepad++ for Unity3D on Linux

As soon as you have Unity3D running on your favorite Linux distribution, it’s high time to install a tool for editing your scripts. MonoDevelop is a default editor for editing code, but I prefer using Notepad ++. If you prefer using MonoDevelop, just download a Windows installer to use it with Wine. In my opinion, using Linux version seems impossible for applying.

To get details how to install Unity3D on Linux, go to the link:

https://tomaszzackiewicz.wordpress.com/2013/11/16/run-unity3d-on-linux-with-wine-solved/

1/ Download Notepad++ (npp.6.x.x.Installer.exe)

2/ Open Unity3D Editor

3/ Edit -> Preferences

4/ You see a small window with preferences

5/ Click External Tools -> External Tools Editor -> Search for npp.6.x.x.Installer.exe -> Open -> Close Preferences Window

6/ Nothing happens.

7/ Right click any script in Inspector (Unity3D) -> Edit Script (or in Project window choose right click on the file and choose Open, or click two times on the file you wish to edit)

8/ npp.6.x.x.Installer.exe starts to install Notepad++ on your HDD (You can select the language of installation here)

9/ Install Notepad++ just like on Windows

10/ When you finish, nothing happens

11/ Edit -> Preferences

12/ Click External Tools -> External Tools Editor -> Search for Notepad++ executable icon on your HDD ( you probably can find it at: your_home_directory/wineprefix/Unity3D/drive_c/Program Files/Notepad++/notepad++.exe) -> Open -> Close Preferences Window

13/ Nothing happens

14/ Right click any script in Inspector (Unity3D) -> Edit Script (or in Project window choose right click on the file and choose Open, or click two times on the file you wish to edit)

15/ Your script is opened in Notepad++

That’s all!

Run Unity3D on Linux with Wine – solved!

Run Unity3D on Linux with Wine – solved!

Contents

Disclaimer

Requirements

Introduction

Tested Successfully on Distros

The Script

Tutorial

Unity3D Web Player

WineBrowser Changes

Potential Problems

More info

Remarks

Thanks

Disclaimer

All information herein is presented “as-is”, with no warranties expressed nor implied. If you lost any data or something else, it’s not my fault.

I’m one of the authors of the script. The fifth version was improved by me. This article is about running Unity3D on Linux, so these scripts aren’t for copy&paste, but for reference. That’s why, they aren’t in plain text. To get them, please go to the thread, where the authors placed them. My intention was only presenting how all stuff work, how to handle this software, and propagate knowledge of it. However, I placed the fifth script in plain text, too, because my readers copied the Unicode text and had many problems with running Unity3D and MonoDevelop (go to the Tutorial section to get the script).

Requirements

Linux (openSuse 13.X is the best I think)

Unity3D (the recent version)

Notepad++ (the recent version; optionally; if you can’t run MonoDevelop because of any reasons, you can always use this editor; Notepad++ is simply much faster than MonoDevelop)

MonoDevelop (the one installed with Unity3D)

PlayOnLinux (the recent version)

Wine (the recent version)

Mesa 3D Library (the recent version for 3D rendering)

Intel graphics card (Intel cooperates with Mesa the best; there can be problems with other graphics cards, so maybe not Mesa, but proprietary drivers are better for you – check which graphics card you have first!)

The Script (the recent version should work the best; if not, use the previous version)

other software like Pipelight Project for using Unity3D Web Player under Linux.

Tested Successfully on Distros

openSuse 13.1

Fedora 20

Ubuntu 13.10

Debian Jessie

Introduction

Because there’s no still Unity Editor for Linux, many people are trying to run Unity Editor for Windows on Linux. Yes, Wine is an alternative for you. However, I was trying many ways to run Unity3D on Linux and nothing worked. But I found the thread on Unity Forum:

http://forum.unity3d.com/threads/211059-Unity3D-on-Linux-with-Wine-Support-thread

It was started by Cauê from Brazil. This man did nothing new, but in reality he helped me much. I used Wine and I was able to solve all those problems with running Unity3D. But I had to give up because I couldn’t create a New Project for Unity3D.  All the solutions I found in the Internet sucked.

Cauê wrote a script (you can find it at that link) that automates the process of installing Unity3D with Wine on Linux. And he uses PlayOnLinux to accomplish that. Yes, it’s a good way to be successful with installing Unity3D on Linux.

But the script was still imperfect. We couldn’t create Unity projects; we needed tricks to do that. xplicit-ru and other users did much to fix some problems, but the whole script was improved by Damian-LinuxFan from Poland. And now you can make Unity projects with no problems.

The Script

Below the script evolution (Unicode – don’t copy&paste because you can have problems! For reference only!):

Cauê’s script (the first version):

#!/bin/bash

[ “$PLAYONLINUX” = “” ] && exit 0

source “$PLAYONLINUX/lib/sources”

POL_SetupWindow_Init

POL_SetupWindow_presentation “Unity 3D” “Unity” “http://www.unity3d.com/” “Cauê Waneck” “Unity3D”

#create prefix

export WINEARCH=”win32″

POL_Wine_SelectPrefix “Unity3D”

POL_Wine_PrefixCreate “1.7.13”

#setup prefix

POL_Wine_InstallFonts

#POL_Call POL_Install_directx9

POL_Call POL_Install_dotnet20

POL_Call POL_Install_tahoma

mkdir -p $WINEPREFIX/drive_c/users/$USER/AppData/LocalLow

#registry

regfile=$(mktemp –suffix=.REG)

echo “REGEDIT4” > $regfile

echo “” >> $regfile

echo “[HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\CurrentVersion]” >> $regfile

echo ‘”ProductId”=”12345-oem-0000001-54321″‘ >> $regfile

POL_Wine regedit $regfile

#rm $regfile

POL_SetupWindow_browse “Please select the location of the Unity3D setup executable” “Unity Setup Executable”

UNITYLOC=$APP_ANSWER

POL_Wine $UNITYLOC

POL_Shortcut “Unity.exe” “Unity 3D”

POL_SetupWindow_Close

exit

Damian’s script (the second version):

#!/bin/bash

[ “$PLAYONLINUX” = “” ] && exit 0

source “$PLAYONLINUX/lib/sources”

POL_SetupWindow_Init

POL_SetupWindow_presentation “Unity 3D” “Unity” “http://www.unity3d.com/” “Unity3D”

#create prefix

export WINEARCH=”win32″

POL_Wine_SelectPrefix “Unity3D”

POL_Wine_PrefixCreate “1.7.13”

#setup prefix

POL_Wine_InstallFonts

#POL_Call POL_Install_directx9

POL_Call POL_Install_dotnet20

POL_Call POL_Install_tahoma

POL_Call POL_Install_vcrun2008

POL_Call POL_Install_vcrun2010

POL_Call POL_Install_mono210

POL_Call POL_Install_d3dx9_36

POL_Call POL_Install_d3dcompiler_43

POL_Call POL_Install_dxdiag

POL_Call POL_Install_dxfullsetup

POL_Call POL_Install_physx

POL_Call POL_Install_corefonts

POL_Call POL_Install_msxml6

POL_Call POL_Install_wininet

POL_Call POL_Install_ie6

#Setting OS wer

Set_OS  “winxp”

#Setting mono forcing in MonoDevelop

POL_Wine_OverrideDLL “native” “mscore”

POL_Wine_OverrideDLL “” “mscorsvw.exe”

mkdir -p $WINEPREFIX/drive_c/users/$USER/AppData/LocalLow

#registry

regfile=$(mktemp –suffix=.REG)

echo “REGEDIT4” > $regfile

echo “” >> $regfile

echo “[HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\CurrentVersion]” >> $regfile

echo ‘”ProductId”=”12345-oem-0000001-54321″‘ >> $regfile

POL_Wine regedit $regfile

#rm $regfile

POL_SetupWindow_browse “Please select the location of the Unity3D setup executable” “Unity Setup Executable”

UNITYLOC=$APP_ANSWER

POL_Wine $UNITYLOC

POL_Shortcut “Unity.exe” “Unity 3D”

POL_SetupWindow_Close

exit

However, I was unable to install Internet Explorer 6, and still couldn’t create Unity projects. That’s why, I edited the script slightly:

Instead of

POL_Call POL_Install_ie6

I wrote:

POL_Call POL_Install_ie8

So the script looks in this way (the third version):

#!/bin/bash

[ “$PLAYONLINUX” = “” ] && exit 0

source “$PLAYONLINUX/lib/sources”

POL_SetupWindow_Init

POL_SetupWindow_presentation “Unity 3D” “Unity” “http://www.unity3d.com/” “Unity3D”

#create prefix

export WINEARCH=”win32″

POL_Wine_SelectPrefix “Unity3D”

POL_Wine_PrefixCreate “1.7.13”

#setup prefix

POL_Wine_InstallFonts

#POL_Call POL_Install_directx9

POL_Call POL_Install_dotnet20

POL_Call POL_Install_tahoma

POL_Call POL_Install_vcrun2008

POL_Call POL_Install_vcrun2010

POL_Call POL_Install_mono210

POL_Call POL_Install_d3dx9_36

POL_Call POL_Install_d3dcompiler_43

POL_Call POL_Install_dxdiag

POL_Call POL_Install_dxfullsetup

POL_Call POL_Install_physx

POL_Call POL_Install_corefonts

POL_Call POL_Install_msxml6

POL_Call POL_Install_wininet

POL_Call POL_Install_ie8

#Setting OS wer

Set_OS  “winxp”

#Setting mono forcing in MonoDevelop

POL_Wine_OverrideDLL “native” “mscore”

POL_Wine_OverrideDLL “” “mscorsvw.exe”

mkdir -p $WINEPREFIX/drive_c/users/$USER/AppData/LocalLow

#registry

regfile=$(mktemp –suffix=.REG)

echo “REGEDIT4” > $regfile

echo “” >> $regfile

echo “[HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\CurrentVersion]” >> $regfile

echo ‘”ProductId”=”12345-oem-0000001-54321″‘ >> $regfile

POL_Wine regedit $regfile

#rm $regfile

POL_SetupWindow_browse “Please select the location of the Unity3D setup executable” “Unity Setup Executable”

UNITYLOC=$APP_ANSWER

POL_Wine $UNITYLOC

POL_Shortcut “Unity.exe” “Unity 3D”

POL_SetupWindow_Close

exit

However, we can’t still run MonoDevelop. We need all .NET versions installed.

My script that I wrote with cooperation with Goran Grncaroski (the fourth version):

#!/bin/bash

[ “$PLAYONLINUX” = “” ] && exit 0

source “$PLAYONLINUX/lib/sources”

POL_SetupWindow_Init

POL_SetupWindow_presentation “Unity 3D” “Unity” “http://www.unity3d.com/” “Unity3D”

#create prefix

export WINEARCH=”win32″

POL_Wine_SelectPrefix “Unity3D”

POL_Wine_PrefixCreate “1.7.13”

#setup prefix

POL_Wine_InstallFonts

#POL_Call POL_Install_directx9

POL_Call POL_Install_dotnet20

POL_Call POL_Install_dotnet35

POL_Call POL_Install_dotnet40

POL_Call POL_Install_tahoma

POL_Call POL_Install_vcrun2008

POL_Call POL_Install_vcrun2010

POL_Call POL_Install_mono210

POL_Call POL_Install_d3dx9_36

POL_Call POL_Install_d3dcompiler_43

POL_Call POL_Install_dxdiag

POL_Call POL_Install_dxfullsetup

POL_Call POL_Install_physx

POL_Call POL_Install_corefonts

POL_Call POL_Install_msxml6

POL_Call POL_Install_wininet

POL_Call POL_Install_ie8

#Setting OS wer

Set_OS  “winxp”

#Setting mono forcing in MonoDevelop

POL_Wine_OverrideDLL “native” “mscore”

POL_Wine_OverrideDLL “” “mscorsvw.exe”

mkdir -p $WINEPREFIX/drive_c/users/$USER/AppData/LocalLow

#registry

regfile=$(mktemp –suffix=.REG)

echo “REGEDIT4” > $regfile

echo “” >> $regfile

echo “[HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\CurrentVersion]” >> $regfile

echo ‘”ProductId”=”12345-oem-0000001-54321″‘ >> $regfile

POL_Wine regedit $regfile

#rm $regfile

POL_SetupWindow_browse “Please select the location of the Unity3D setup executable” “Unity Setup Executable”

UNITYLOC=$APP_ANSWER

POL_Wine $UNITYLOC

POL_Shortcut “Unity.exe” “Unity 3D”

POL_SetupWindow_Close

exit

I made the script more professional and adjust it for debugging (the fifth version):

#!/bin/bash

# Date : (2014-03-07 10-21)
# Last revision : (2014-03-07 10-21)
# Wine version used : 1.7.14
# Distribution used to test : OpenSuse 13.1
# Authors : waneck-six, Damian-LinuxFan, Tomza (pogtoma@gmail.com)
# Contributors: Goran Grncaroski (running MonoDevelop), other people (testing solutions)
# Script licence : GPL v.2
# Only For : http://www.playonlinux.com
# Depend :

# Known Issues : You can’t use Asset Store

[ “$PLAYONLINUX” = “” ] && exit 0
source “$PLAYONLINUX/lib/sources”

TITLE=”Unity 3D”
PREFIX=”Unity3D”
WINE_VERSION=”1.7.14″

POL_SetupWindow_Init
POL_Debug_Init

POL_SetupWindow_presentation “$TITLE” “Unity” “http://www.unity3d.com/” “waneck-six, Damian-LinuxFan, Tomza” “$PREFIX”

#create prefix
export WINEARCH=”win32″
POL_Wine_SelectPrefix “$PREFIX”
POL_Wine_PrefixCreate “$WINE_VERSION”

#setup prefix
POL_Wine_InstallFonts
POL_Call POL_Install_dotnet20
POL_Call POL_Install_dotnet35
POL_Call POL_Install_dotnet40
POL_Call POL_Install_tahoma
POL_Call POL_Install_vcrun2008
POL_Call POL_Install_vcrun2010
POL_Call POL_Install_mono210
POL_Call POL_Install_d3dx9_36
POL_Call POL_Install_d3dcompiler_43
POL_Call POL_Install_dxdiag
POL_Call POL_Install_dxfullsetup
POL_Call POL_Install_physx
POL_Call POL_Install_corefonts
POL_Call POL_Install_msxml6
POL_Call POL_Install_wininet
POL_Call POL_Install_ie8

#Setting OS wer
Set_OS  “winxp” “sp3”

#Setting mono forcing in MonoDevelop
POL_Wine_OverrideDLL “native” “mscore”
POL_Wine_OverrideDLL “” “mscorsvw.exe”

mkdir -p $WINEPREFIX/drive_c/users/$USER/AppData/LocalLow

#registry
regfile=$(mktemp –suffix=.REG)
echo “REGEDIT4” > $regfile
echo “” >> $regfile
echo “[HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\CurrentVersion]” >> $regfile
echo ‘”ProductId”=”12345-oem-0000001-54321″‘ >> $regfile

POL_Wine regedit $regfile

POL_SetupWindow_browse “Please select the location of the Unity3D setup executable” “$TITLE”

UNITYLOC=$APP_ANSWER
POL_Wine $UNITYLOC

POL_Shortcut “Unity.exe” “$TITLE”

POL_SetupWindow_Close
exit

The previous script isn’t still perfect, and Unity3D and MonoDevelop crash sometimes, especially when you start it for the first time.

gnumaru add two lines:

POL_Call POL_Install_directx9
POL_Wine_OverrideDLL “builtin, native” “dnsapi”

This script hasn’t been tested by me yet. But you can test it and share results:

gnumaru’s version (the sixth version):

#!/bin/bash

# Date : (2014-03-07 10-21)
# Last revision : (2014-03-14 10-35)
# Wine version used : 1.7.14
# Distribution used to test : Ubuntu 13.10
# Authors : waneck-six, Damian-LinuxFan, Tomza (pogtoma@gmail.com), gnumaru
# Contributors: Goran Grncaroski (running MonoDevelop), other people (testing solutions)
# Script licence : GPL v.2
# Only For : http://www.playonlinux.com
# Depend :

# Known Issues : Asset Store window does not work at all

[ “$PLAYONLINUX” = “” ] && exit 0
source “$PLAYONLINUX/lib/sources”

TITLE=”Unity 3D”
PREFIX=”Unity3D”
WINE_VERSION=”1.7.14″

POL_SetupWindow_Init
POL_Debug_Init

POL_SetupWindow_presentation “$TITLE” “Unity” “http://www.unity3d.com/” “waneck-six, Damian-LinuxFan, Tomza, gnumaru” “$PREFIX”

#create prefix
export WINEARCH=”win32″
POL_Wine_SelectPrefix “$PREFIX”
POL_Wine_PrefixCreate “$WINE_VERSION”

#setup prefix
POL_Wine_InstallFonts
POL_Call POL_Install_directx9
POL_Call POL_Install_dotnet20
POL_Call POL_Install_dotnet35
POL_Call POL_Install_dotnet40
POL_Call POL_Install_tahoma
POL_Call POL_Install_vcrun2008
POL_Call POL_Install_vcrun2010
POL_Call POL_Install_mono210
POL_Call POL_Install_d3dx9_36
POL_Call POL_Install_d3dcompiler_43
POL_Call POL_Install_dxdiag
POL_Call POL_Install_dxfullsetup
POL_Call POL_Install_physx
POL_Call POL_Install_corefonts
POL_Call POL_Install_msxml6
POL_Call POL_Install_wininet
POL_Call POL_Install_ie8

#Setting OS wer
Set_OS “winxp” “sp3”

#Setting mono forcing in MonoDevelop
POL_Wine_OverrideDLL “native, builtin” “mscore”
POL_Wine_OverrideDLL “builtin, native” “dnsapi”
POL_Wine_OverrideDLL “” “mscorsvw.exe”

mkdir -p $WINEPREFIX/drive_c/users/$USER/AppData/LocalLow

#registry
regfile=$(mktemp –suffix=.REG)
echo “REGEDIT4” > $regfile
echo “” >> $regfile
echo “[HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\CurrentVersion]” >> $regfile
echo ‘”ProductId”=”12345-oem-0000001-54321″‘ >> $regfile

POL_Wine regedit $regfile

POL_SetupWindow_browse “Please select the location of the Unity3D setup executable” “$TITLE”

UNITYLOC=$APP_ANSWER
POL_Wine $UNITYLOC

POL_Shortcut “Unity.exe” “$TITLE”

POL_SetupWindow_Close
exit

There’s some improvement as to the script made by Doctor Jellyface. He fixed the registry.

This version is untested by me! If it doesn’t work, just use the previous version of the script.

Doctor Jellyface’s version (the seventh version):

#!/bin/bash

# Date : (2014-03-07 10-21)
# Last revision : (2014-03-07 10-21)
# Wine version used : 1.7.14
# Distribution used to test : OpenSuse 13.1
# Authors : waneck-six, Damian-LinuxFan, Tomza (pogtoma@gmail.com), gnumaru, Doctor Jellyface (doctorjellyface@riseup.net)
# Contributors: Goran Grncaroski (running MonoDevelop), other people (testing solutions)
# Script licence : GPL v.2
# Only For : http://www.playonlinux.com
# Depend :

# Known Issues : You can’t use Asset Store

[ “$PLAYONLINUX” = “” ] exit 0
source “$PLAYONLINUX/lib/sources”

TITLE=”Unity 3D”
PREFIX=”Unity3D”
WINE_VERSION=”1.7.14″

POL_SetupWindow_Init
POL_Debug_Init

POL_SetupWindow_presentation “$TITLE” “Unity” “http://www.unity3d.com/” “waneck-six, Damian-LinuxFan, Tomza, gnumaru, DoctorJellyface” “$PREFIX”

#create prefix
export WINEARCH=”win32″
POL_Wine_SelectPrefix “$PREFIX”
POL_Wine_PrefixCreate “$WINE_VERSION”

#setup prefix
POL_Wine_InstallFonts
POL_Call POL_Install_directx9
POL_Call POL_Install_dotnet20
POL_Call POL_Install_dotnet35
POL_Call POL_Install_dotnet40
POL_Call POL_Install_tahoma
POL_Call POL_Install_vcrun2008
POL_Call POL_Install_vcrun2010
POL_Call POL_Install_mono210
POL_Call POL_Install_d3dx9_36
POL_Call POL_Install_d3dcompiler_43
POL_Call POL_Install_dxdiag
POL_Call POL_Install_dxfullsetup
POL_Call POL_Install_physx
POL_Call POL_Install_corefonts
POL_Call POL_Install_msxml6
POL_Call POL_Install_wininet
POL_Call POL_Install_ie8

#Setting OS wer
Set_OS “winxp” “sp3”

#Setting mono forcing in MonoDevelop
POL_Wine_OverrideDLL “native, builtin” “mscore”
POL_Wine_OverrideDLL “builtin, native” “dnsapi”
POL_Wine_OverrideDLL “” “mscorsvw.exe”

mkdir -p $WINEPREFIX/drive_c/users/$USER/AppData/LocalLow

#registry
POL_Wine reg add “HKLM\Software\Microsoft\Windows NT\CurrentVersion” /v ProductId /t REG_SZ /d 12345-oem-0000001-54321

POL_SetupWindow_browse “Please select the location of the Unity3D setup executable” “$TITLE”

UNITYLOC=$APP_ANSWER
POL_Wine $UNITYLOC

POL_Shortcut “Unity.exe” “$TITLE”

POL_SetupWindow_Close
exit

Tutorial

To help you run Unity3D on Linux, I prepared 20-steps tutorial for you how to install Unity3D on Linux:

1. Download Unity3D

2. Download and install PlayOnLinux (Warning: you probably should install cabextract and python-wxWidgets first to run PlayOnLinux on your computer)

3. Start PlayOnLinux

When you run PlayOnLinux for the first time, you will get PlayOnLinux Wizard (PlayOnLinux first use):

a/ The first warning

PlayOnLinux cannot find wine (from Wine)

You should install it to use PlayOnLinux

Click OK

b/ The second warning

PlayOnLinux cannot find 7z (from P7ZIP full)

You should install it to use PlayOnLinux

Click OK

c/ Windows Fonts useful for all programs you will run on PlayOnLinux

Install Windows fonts

Click Next

d/ When all is ready

You should see:

Enjoy using PlayOnLinux

Some of these warnings you can see later, too.

4. Tools->Manage Wine Versions

5. Choose the recent Wine version (Warning: remember that the newest Wine can be unstable (Wine 1.6.2 is stable), but, at the same time, some bugs can be fixed in the recent version, and that’s why it can be the best way to go for you; fortunately, you can choose the Wine version in PlayOnLinux you like; the recent version is recommended for running Unity3D because of 3D improvements)

6. Click an arrow to install your version of Wine

a/ installing some software

When you run PlayOnLinux for the first time, you will some software being installed automatically by PlayOnLinux

7. Tools -> Run a local script

8. Choose the script that was made for automating the installation process of Unity3D. (You should have it on your disk in plain text – unity.pol. You can call it as you want, but the .pol extension should be kept so that PlayOnLinux can recognize it as its script.

The seventh version of the script should work the best for you. Thanks to it, you can use the built in MonoDevelop for creating and editing scripts for Unity3D under Linux.

Warning: If you copy&paste the scripts above from my article, please be careful. It’s Unicode, not plain text. You should go to the thread to get them. However, because you are lazy, I placed the seventh script in plain text here. I hope it will be working for you with no any problems. Just copy&paste and enjoy Unity3D and MonoDevelop on Linux :).

unity.pol

By Cauê Waneck (waneck-six), Damian Kucharski (Damian-LinuxFan), Tomasz Zackiewicz (Tomza), gnumaru and Doctor Jellyface

the seventh version of the script in plain text


#!/bin/bash

# Date : (2014-03-07 10-21)
# Last revision : (2014-03-07 10-21)
# Wine version used : 1.7.14
# Distribution used to test : OpenSuse 13.1
# Authors : waneck-six, Damian-LinuxFan, Tomza (pogtoma@gmail.com), gnumaru, Doctor Jellyface (doctorjellyface@riseup.net)
# Contributors: Goran Grncaroski (running MonoDevelop), other people (testing solutions)
# Script licence : GPL v.2
# Only For : http://www.playonlinux.com
# Depend :

# Known Issues : You can't use Asset Store

[ "$PLAYONLINUX" = "" ] exit 0
source "$PLAYONLINUX/lib/sources"

TITLE="Unity 3D"
PREFIX="Unity3D"
WINE_VERSION="1.7.14"

POL_SetupWindow_Init
POL_Debug_Init

POL_SetupWindow_presentation "$TITLE" "Unity" "http://www.unity3d.com/" "waneck-six, Damian-LinuxFan, Tomza, gnumaru, DoctorJellyface" "$PREFIX"

#create prefix
export WINEARCH="win32"
POL_Wine_SelectPrefix "$PREFIX"
POL_Wine_PrefixCreate "$WINE_VERSION"

#setup prefix
POL_Wine_InstallFonts
POL_Call POL_Install_directx9
POL_Call POL_Install_dotnet20
POL_Call POL_Install_dotnet35
POL_Call POL_Install_dotnet40
POL_Call POL_Install_tahoma
POL_Call POL_Install_vcrun2008
POL_Call POL_Install_vcrun2010
POL_Call POL_Install_mono210
POL_Call POL_Install_d3dx9_36
POL_Call POL_Install_d3dcompiler_43
POL_Call POL_Install_dxdiag
POL_Call POL_Install_dxfullsetup
POL_Call POL_Install_physx
POL_Call POL_Install_corefonts
POL_Call POL_Install_msxml6
POL_Call POL_Install_wininet
POL_Call POL_Install_ie8

#Setting OS wer
Set_OS "winxp" "sp3"

#Setting mono forcing in MonoDevelop
POL_Wine_OverrideDLL “native, builtin” “mscore”
POL_Wine_OverrideDLL “builtin, native” “dnsapi”
POL_Wine_OverrideDLL "" "mscorsvw.exe"

mkdir -p $WINEPREFIX/drive_c/users/$USER/AppData/LocalLow

#registry
POL_Wine reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion" /v ProductId /t REG_SZ /d 12345-oem-0000001-54321

POL_SetupWindow_browse "Please select the location of the Unity3D setup executable" "$TITLE"

UNITYLOC=$APP_ANSWER
POL_Wine $UNITYLOC

POL_Shortcut "Unity.exe" "$TITLE"

POL_SetupWindow_Close
exit

 

Note: it’s good to edit the script to change to the recent Wine version before installing all software

POL_Wine_PrefixCreate “Your.Version.Number”

for example, my version is Wine 1.7.20, so I should write in the script:

POL_Wine_PrefixCreate “1.7.20”

That’s all.

You will see the warning that the signature of the script isn’t valid. Ignore it!

Next

You will be able to review your script and check if its content is OK before running. If OK, check I agree

Next

You will see:

Welcome to PlayOnLinux installation Wizard

Next

The script is running

a virtual drive is being created first – it will be the place where your whole installation will be placed.

a/ The environment for the virtual disk

When you run PlayOnLinux for the first time, some software can be installed

9. The installation is going – it isn’t too easy and you can even see some errors because you probably will be forced to install some additional software in your operating system.

After our tests, we know that to run Unity3D and MonoDevelop with no problems, we need all .NET versions installed in Wine. They all will be added automatically by the script, so no worries.

I have no idea of what exactly you should install – it depends on the system you have. For example, I had to install python-wxWidgets (and maybe wxPython).  To get more details, read my article:

https://tomaszzackiewicz.wordpress.com/2013/11/15/an-import-wxversion-error/

10. PlayOnLinux is installing the components it needs for Unity3D and MonoDevelop working on Wine. The list of their names is included in the script you are using. They are really important, so wait to the end of the installation patiently.

11. When the script in PlayOnLinux installs up all the components in Wine, find the Unity3D setup executable on your disk through the PlayOnLinux window.

12. Install Unity3D with using PlayOnLinux (just like under Windows).

13. Follow the instructions you see during the Unity3D installation. Among others, you need NET Framework 4.0 Extended. All will be installed automatically. Do not worry about errors too much if any – maybe they aren’t so important (PlayOnLinux is buggy, though the 4.2.2 version is much better). PlayOnLinux can be even hanged up. Reboot PlayOnLinux if you need. Keep going!

14. Click Finish on the Unity3D installation wizard.

15. When Unity3D is installed inside PlayOnLinux, you see the Unity3D icon in the main PlayOnLinux window – you can start Unity3D from here if you want.

16. Unity3D can run automatically in a moment.

17. You can see two Unity3D icons on your desktop. One of them doesn’t work (Unity). Use Unity3D instead (sometimes, both shortcuts work). Maybe you will see one icon only – I don’t know.

Warning: If you reinstall Unity3D (install again on the same computer), it’s good to remove the remaining shortcut on your desktop (one of the two). One is removed automatically, but the second remains. It can make problems for making a new shortcut for a new Unity3D installation. You may do that even during Unity3D installation, but before the end of the installation because the new shortcuts are made in this time. If you don’t do that, your installation can be corrupted. You will see only one shortcut on your desktop. But this shortcut probably won’t work.

18. Do everything Unity3D wants from you (Activate your Unity License – free or pro; log in to your Unity3D account – you should have the account; if don’t, make one; then, click Start using Unity).

19. When you see the dialog (Project Wizard) for creating or opening a new project for Unity3D, just do that as if you worked on Windows. That’s all!

20. Unity3D is running!!!

Now, you can create and edit scripts in the built in MonoDevelop for Unity3D under Linux, just like under Window. Together with Goran Grncaroski, I was able to write the script (the fourth version) that can ran not only Unity3D but also the MonoDevelop.

For editing scripts, I’ll still be using Notepad++ along with MonoDevelop. Go to the link

https://tomaszzackiewicz.wordpress.com/2013/12/01/how-to-setup-notepad-for-unity/

to know how to do that. Notepad++ is a very good tool, because it’s simple and quick.  I used it before, making my first game on Windows. For bigger scripts and for debugging, use MonoDevelop.

Unity3D Web Player

To use Unity3D Web Player under Linux, please go to the link:

https://tomaszzackiewicz.wordpress.com/2014/01/30/unity3d-and-pipelight-project/

WineBrowser Changes

Note: Optionally – it can be changed in the future. It isn’t critical for running Unity3D on Linux and making Unity3D projects, so you can skip this.

You should also do some fixes in Wine Windows registry for opening links inside Wine. Open main PlayOnLinux window -> click Configure (the gear wheel icon) ->  click Unity disk on your left -> Wine tab -> open Regedit by clicking -> You should see the well-known for you window for editing Windows Registry (regedit).

Go to HKEY_CURRENT_USER (HKCU) -> Software -> Wine -> WineBrowser

If you don’t see it, you have to create one.

Right click on the Wine key -> Key -> name it WineBrowser

Right click on the right side of Regedit window -> New -> Key -> String

Call the string you have just created Browsers, and its value should be xdg-open,firefox, opera,konqueror

You can write browser you want in the value. xdg-open should be the first. Because of that, clicking on a link in Wine, you will open the link by your default browser in your operating system.

Then, go to HKEY_CLASSES_ROOT -> http -> shell -> open -> command

On your right side you probably see:

“C:\windows\system32\winebrowser.exe” -nohome

You should write “%1” at the end, so it should look:

“C:\windows\system32\winebrowser.exe” -nohome “%1”

Now you can open links in Wine in your default Linux browser. You can check it in

/home/poganin/.PlayOnLinux/wineprefix/Unity3D/system.reg

Open the system.reg file. You should see something like that:

[Software\\Classes\\http\\shell\\open\\command] 1390676532

@=”\”C:\\windows\\system32\\winebrowser.exe\” -nohome \”%1\””

The same you could do for HTTPS:

HKEY_CLASSES_ROOT -> https -> shell -> open -> command

Potential Problems

Warning: There can still be issues with Unity3D on Linux. But we are working so that all works perfectly.

1/ Because PlayOnLinux creates a special disk for installing Unity3D on Linux, this installation is isolated. So if you try to run for example a .blend file to edit inside Unity3D, it won’t be opened automatically because Blender is installed outside this special disk on your computer.To solve it, search solutions on:

http://wiki.unity3d.com/index.php/Running_Unity_on_Linux_through_Wine

or use Unity3D installation on Linux without PlayOnLinux from:

https://github.com/Unity3D-Wine-Support/Unity3D-on-Wine/blob/master/unity3d.verb

However, I’m not sure if this solution will be working so easy like that method with using PlayOnLinux. That’s why, I recommend the installation of Unity3D on Linux with PlayOnLinux for beginners.

2/ I know it works with openSuse 13.1 and I’m not sure as to other distributions. Unity3D is stable enough to make games. It’s really amazing how it works on openSuse with Intel graphics card. Some people say that it works with Ubuntu, too.

3/ To import unitypackages:

Assets -> Import package -> Custom Package… -> search your .unitypackage -> import it to your Unity3D

I couldn’t start NGUI.unitypackage from outside Unity as it is on Windows. I had to import it from inside Unity3D Editor.

4/ I couldn’t import assets from Asset Store from the Unity3D website.

5/ If you have problems with the Mesa drivers, go to the link

https://tomaszzackiewicz.wordpress.com/2014/01/27/unable-to-load-driver-i965_dri-so-a-3d-graphics-mesa-error/

Warning: Mesa is developed by Intel, so Intel graphics cards are always fully supported. But if you have other graphics card, proprietary drivers can be better. However, these drivers contain many bugs and your Unity3D can be unstable, for example, problem with refreshing windows in the editor.

More info

read also:

http://wiki.unity3d.com/index.php/Running_Unity_on_Linux_through_Wine

the recent changes to the script:

https://github.com/Unity3D-Wine-Support/Unity3D-on-Wine

for the problems you can’t find in my tutorial, use Unofficial IRC channel on freenode: #unity3d-wine

Remarks

If you see any error in my tutorial or you wish to improve it, please let me know. I hope my English is good enough. Thanks!

Thanks

Thanks to Cauê Waneck (waneck-six) and Damian Kucharski (Damian-LinuxFan) for the Script that started the revolution for many people in the world.

Thanks to Goran Grncaroski for helping me running the built in MonoDevelop for Unity3D under Linux.

Thanks to other users who improved and tested this solution on many distros.

Unity3D on Linux – a wonderful idea!

Guys, please leave your opinion below. Just write the system you are using, your graphics card, etc. It’s important for us, developers, to improve our solution. We are doing that to you for free. So please help us.

We’ll be waiting for Unity 3D Editor on Linux very long

We’ll be waiting for Unity 3D Editor on Linux very long

I wrote to Unity Technologies an e-mail. And I got the answer:

Thank you for your email to Unity Technologies. I’m sorry you have felt forced to stop using Unity due to platform issues. The Linux community is important to us and there may be plans in the future for you guys, but for now, it isn’t in our pipeline.

Please submit your feedback directly to our development team who take all feedback seriously. You can do this here:

http://feedback.unity3d.com/

I submitted my feedback a long ago. I don’t believe Unity Team take these all words into considerations. The most important are profits for the company. And they think they won’t earn money on Linux. Well, they are wrong. Linux is a huge industry. It’s hard to say how many Linux users are in the world. Some people simply use Windows, but they play with Linux too. There are many, many Linux followers. And some of them will buy the license because Linux is a better platform for 3D graphics than Windows is. Alas, the power of Micro$oft is dictating terms. And Unity Community means nothing in reality.

Linux vs. Windows

Linux vs. Windows

I changed my Windows into openSuse and I’m glad. It’s one of my best decisions in my life. At last, I feel free with my computer. It’s bad many software companies are trying not to see Linux users. I’m really angry with them. The freedom would be more beautiful if every Windows software had always its equivalent in Linux. So far, it’s my dreams only. I’m a game developer, and the most powerful game engines are for Windows only. However, I won’t give up. I was forced to leave Unity 3D for Blender. Blender is a really good game engine; maybe even better than Unity 3D. Full modeling and animation support. No problems with exporting. Now, I’m learning Blender. Soon, you will get my new games. Some of them will be for free. So be patient!