How do I rotate a Quaternion with 2nd Quaternion on its local or world axes without using transform.Rotate?

Use the Quaternion operator *. In Unity, when you multiply two quaternions, it applies the second quaternion (expressed in global axes) to the first quaternion along the local axes produced after the first Quaternion). So, if you want to do the equivalent of Rotate(q2, Space.Self), where q1 is the transform’s original rotation, and q3 is … Read more

Upgrading old Unity code to Unity 5

what did i do wrong or did unity change it? Unity changed. I’ve seen similar questions for the past few weeks. Although I don’t think they are duplicates but it would make sense to answer all these here for future questions. The animation variable is defined under Component as a public variable which MonoBehaviour inherits … Read more

Location of Application.persistentDataPath in a build

In the answer below: companyname = Company name from the Build Settings productname = Product name from the Build Settings Windows: C:\Users\<userprofile>\AppData\LocalLow\<companyname>\<productname> Windows Store: %userprofile%\AppData\Local\Packages\<productname>\LocalState Mac: ~/Library/Application Support/companyname/productname older version of Unity on Mac: ~/Library/Caches folder ~/Library/Application Support/unity.companyname.productname. Linux: $XDG_CONFIG_HOME/unity3d/<companyname>/<productname> which is the-same as ~/.config/unity3d/<companyname>/<productname> Android: /Data/Data/com.<companyname>.<productname>/files with SD card on the Android device: /storage/sdcard0/Android/data/com.<companyname>.<productname>/files … Read more

Find inactive GameObject by name, tag or layer

The problem is that Unity cannot find inactive GameObjects. GameObject.Find will only find active GameObject. You should either find and store the GameObject in a global variable or make the variable public then assign it from the Editor. My solution uses a global variable then stores the GameObject in the beginner so that you don’t … Read more

Unity Zxing QR code scanner integration

I was looking for integrating Zxing with vuforia in Unity today. The first thing to do is to download the dll from : https://zxingnet.codeplex.com/ and copy the unity dll into your Plugins folder (which should be in the Assets folder) Then, I managed to found some examples (some of theses is outdated) : http://ydaira.blogspot.fr/2012/09/how-to-decode-qr-codes-using-unity3d.html https://github.com/Redth/ZXing.Net/blob/master/Clients/VuforiaDemo/Assets/VuforiaScanner.cs … Read more