Search Unity

Noob FAQ - Issues and Answers Only PLS!

Discussion in 'Community Learning & Teaching' started by gamescorpion, Mar 31, 2014.

  1. gamescorpion

    gamescorpion

    Joined:
    Feb 15, 2014
    Posts:
    132
    Noob FAQ - Issues and Answers Only PLS!

    If anyone knows me from ShiVa 3D forums, I have been prominently adding all my step by step text tutorials and findings in one special post called Noob FAQ. Now that I'm also starting out in the Unity 3D world, I'd like to start the same process here which I believe will also help out others who are just starting out in Unity with some of the most basic questions.

    HOW DOES THIS POST WORK?

    Simple => Only post Issues with a Solution. This is NOT a discussion post, but a step-by-step solutions post, and hopefully one day it may get onto the sticky list as well.

    FORMAT AND RULES

    1. Start off by typing in the following -

    ISSUE: <Your issue you are solving here>

    OUR/MY SOLUTION: <Your STEP-BY-STEP Solution here>

    2. Keep it SUPER SIMPLE! If a young child of 10 years old was to read it, would they be able to follow your steps? The goal here is to make it deadly simple so that anyone can do it. If it is something that is more advanced, label your issue as an INTERMEDIATE or ADVANCED solution which may require more detailed knowledge.

    3. Many times there may not be only ONE solution. There may be several and someone may find a better way of doing things or may have a faster more efficient method. That's perfect, list it here if you have an easier way or more efficient way. The goal here however is to keep it as EASY as possible so that anyone who is brand new to Unity can easily follow along. ALWAYS RESPECT YOUR FELLOW DEVELOPERS! Things like, "Developer X's solution sucks and he/she is stupid, etc. etc." is unacceptable and should not be done. Respecting your fellow developers requires you to be kind in your sharing of knowledge. The proper way to state things about a better solution would be, "Developer X's solution is one possible solution, thank you for sharing it. I believe I have another solution which is better/more efficient and could also be of benefit as well."

    RESPECTING each other in our industry should not be an afterthought, it should be the way we all do business and grow as an industry. Stay positive and keep on being awesome!

    Enjoy and God Bless!

    Nav
     
    Last edited: Apr 3, 2014
    chasedig, chelnok and OboShape like this.
  2. gamescorpion

    gamescorpion

    Joined:
    Feb 15, 2014
    Posts:
    132
    ISSUE: How do you do an Android Build with Unity 3D? (Unity 3D 4.0 Example)

    OUR SOLUTION:

    After doing this a few times I finally got the hang of it -

    3 STAGE PROCESS

    STAGE 1: Setting up your app as an Android App

    1. Click on (File->Build Settings) from the menu bar above in Unity

    2. Select the Android platform in the Platform List Box

    3. Select "Switch Platform"

    NOTE: If "Switch Platform" is greyed out, this simply means that your app is already in Android mode as a platform and you can move onto the next step.

    STAGE 2: TESTING your Android App

    1. Under the "Scenes In Build" box at the top, click on the "Add Current" button to add the current scene OR simply drag and drop a scene from the Project Explorer window into the "Scenes In Build" box.

    2. Click on the "Player Settings" box in the bottom left and inside your Inspector Window you should see a lot of new options.

    3. Start off by entering in your Company name and your App Product Name and select a Default Icon. (NOTE: If you have not imported an image file in png format into your Unity Project, simply RIGHT CLICK int he Project Explorer window and click on "Import New Asset" and find the image file for the icon you want, and then try this step again by finding the icon which should now be in your project)

    4. Inside your Inspector Window go down (You should still be in the "Player Settings" area in Inspector) to Resolution and Presentation. Depending on your app, you may want to set your default orientation here, or you can leave the settings how they are and move on.

    5. Next click on the ICON section and make sure Unity has Auto-sized your icon into all the required sizes for Android

    6. Next click on the SPLASH IMAGE section and change your splash image (NOTE: This feature only works on Unity Pro Android. Even if you have Unity Pro, your app will still show a Unity logo or watermark if you do not also have Unity Android Pro, so you need both for this to work).

    7. IMPORTANT STEP: Next click on the "OTHER SETTINGS" section and go down to Identification. Here you must enter your app details such as your bundle ID, bundle version, and bundle version code.

    BUNDLE ID - This is simply a made up reverse domain text item. If you know how a website looks => gamescorpion.com for example, the REVERSE domain would be com.gamescorpion. We also need to put our app name into this, so a REVERSE DOMAIN NAME (Also Known as your Bundle ID) of your app would be something like this: com.gamescorpion.actionracing3d (ALL LOWERCASE!!) Another example could be com.gamescorpion.myclockstationpro. IT MUST BE IN THIS SPECIFIC FORMAT: com.your_company.your_app

    BUNDLE VERSION - Once again, a made up value, but it must start off with 1.0 minimum. This is basically your app version. Is it 1.0.0, is it 1.5.2? This is totally up to you, but Unity will use this information to put inside of your final build file (Known as an apk file => Specifically this information goes into the AndroidManifest)

    BUNDLE VERSION CODE - Another made up value, usually defaults as 1, but lets say you are going to put out a next version of the same app, you NEED TO INCREMENT this value. If your app in the market has a version code of 3 and you upload a version code of 1, Google Play will not allow it. You must increment this number HIGHER than the previous version code you may have used. IF THIS IS YOUR FIRST BUILD then it doesnt matter what you use here for now, but keep a note of it, because ALL FUTURE BUILDS will require you to increment this value by at least 1 unit.

    8. For the Minimum API Level, I use the most minimum available on my system which at the time of writing this is Gingerbread. This basically says (In plain english) "Whats the minimum Android Operating system a device must have in order to run your app?" Thats in a nutshell what Minimum API Level is. (For advanced users, this goes into your AndroidManifest and is usually generated as the minsdk field for those who do Android coding)

    9. Next click on the "PUBLISHED SETTINGS" section. I just want you to REMEMBER this section for now, but FOR THE TIME BEING, we are going to skip this section and assume you have not setup a Keystore yet (Which will happen in the next step when we sign the apk build for actually releasing on the Android App Store).

    10. Click on "BUILD" in the Build Settings window and your apk (Android App File) should start building as a DEBUG version. What is a DEBUG version apk file? Simply put its a version of your app that you can use on your end, but you CANNOT sell it or upload it to a store (Google Play will cancel the upload when you try and will ask you to upload a signed apk file). This is simply for testing purposes.

    11. Once your APK file is built (Assuming you got no errors. If you did, you need to go back and check your Unity code to see if there is an error there), you'll now want to connect your device to your computer to copy the apk file over.

    ISSUES WHEN TRYING TO COPY AND INSTALL:

    a. I copied the apk file to my device...HOW DO I INSTALL IT?

    Simply download a file explorer app to view your device. I prefer ES Explorer, which allows me to view all the folders in my device. When I plug in my device (I have a Google Nexus 7) I simply copy my apk file to the Downloads folder, then I open ES File Explorer and find the Downloads folder and then I double tap the apk file which in turn starts the installation procedure.

    b. I cannot copy the apk file to the device (OR Windows wont find my device)

    This issue has to do with some android devices that do not operate as an external storage or do not let you copy files over easily. We have to then turn to another method known as adb which is a more advanced procedure and requires using MS Dos (cmd) commands. I will get a few tutorial links on that, but it does require some work in order to get your apk file onto your android device to test it out. I cannot help with this specifically (Though I've done it myself before) but it can be a lengthy procedure and is usually required for a very few rare devices that do not support attaching your device to your computer like a USB device (Example: Barnes and Noble Nook).

    ADB Tutorials Online:
    https://nookdeveloper.zendesk.com/entries/21943338-NOOK-Developer-Start-Up-Guide#_Sideloading
    http://forum.xda-developers.com/showthread.php?t=1474956

    STAGE 3: FINAL OUTPUT of your Android App

    In order to actually upload your app to any of the markets after you have tested it fully, you need to SIGN it. Apk signing may sound intimidating, but Unity makes it pretty straight forward.

    1. Follow all the steps from Stage 1 and Stage 2 above until you reach Stage 2 STEP 9 (If you remember, I told you to remember this part). This part is how we sign our apk file so lets continue from there. At this point I'm assuming you are looking at the Inspector window in the Publishing Settings section (File->Build Settings->Player Settings->Publishing Settings)

    2. Now click on the checkbox that says "Create New Keystore" (You can skip this step if you've already created a Keystore before, this is for first time users who have never created a Keystore before. Skip to step 4.)

    3. Click on "Browse Keystore" and then select a place where you will setup/use your android keystore (This is how signing will take place). I usually keep my keystore files in C:\AndroidKeystoreUnity (If the folder does not exist, then create it). Give your keystore the name of your company (I used GameScorpion which is my company name, but you can use what you wish), and then click on save. Naming it after your company will help you in the future for organizing things better.

    4. Next it will ask you to enter in a password and confirm it. I used the same password twice. Save this and then move down to the Key section and select "Create New Key"

    5. In the popup window that comes, enter the following details (This is the same procedure if you were setting things up using MSDos Command prompts for Android Signing):

    alias - This is the name that you will refer to in the Key->alias dropdown list.
    password - Enter a password for your Key
    confirm - confirm your password
    Validity - Leave it as default 50 years
    First and Last Name - I usually use my company name here Game Scorpion Inc.
    Organizational Unit - Once again I usually use my company name Game Scorpion Inc.
    Organization - You guessed it...Game Scorpion Inc. (Or your own company name ofcourse)
    City or Locality - Enter your City
    State or Province - Enter your state or Province name
    Countery Code (XX) - Enter the TWO LETTER country code. For example United States is US, Canada is CA, etc.

    6. Finally hit "Create Key" and now you're ready to sign your app and release it. IN THE FUTURE, you will be creating KEYS from your Keystore (So you'll select the same keystore which you made in step 4 above) but every time you'll be creating NEW KEYS for every new app you make. The keystore stays the same, the keys are what change for every new app, so keep this in mind.

    7. Finally hit Build in the Build Settings window, and you should now have a FINAL SIGNED BUILD which you can then deploy to the various Android markets. I HIGHLY RECOMMEND testing this final build on a device to confirm it works correctly.

    COMMON ISSUES:

    a. Can't create keystores or I have not setup my Android SDK Environment.

    Please go HERE (https://docs.unity3d.com/Documentation/Manual/android-sdksetup.html) to setup your Unity Android Environment and then try again.

    ===========

    I hope you enjoyed this step-by-step solution!

    God Bless!

    COME JOIN US ON UNITY SKYPE CHAT TODAY! Add User (sale.rocket - Abhinav Gupta) And you'll be added instantly to the Skype Chat online!
     
    Last edited: Mar 31, 2014
    wanrclhnyd and theANMATOR2b like this.
  3. gamescorpion

    gamescorpion

    Joined:
    Feb 15, 2014
    Posts:
    132
    ISSUE: Just purchased Unity Licenses with add-on's, how do I add the add-ons to my license?

    OUR SOLUTION:

    This happens on Unity side, and your same license key actually has the add-ons with it. You don't have to install anything additional, once your account manager or Unity staff activate your purchase, your same license key will automatically have access to the new capabilities. You may require a restart of your computer system though, but other than that you should be all setup to go.

    I had the same question when I paid for Unity Pro and Unity Android Pro licenses.

    God Bless!

    Nav
     
  4. gamescorpion

    gamescorpion

    Joined:
    Feb 15, 2014
    Posts:
    132
    ISSUE: Just purchased a new asset from the asset store...How do I get it inside of Unity?

    OUR SOLUTION:

    1. Open up Unity

    2. Look at the menu bar above and click on Window=>Asset Store

    3. When the window loads, at the top left of the screen you will see some icons, click on the one that looks like a box with an arrow on it (4th from the left)

    4. You will now see your asset purchases, but now you must download them to your computer before being able to import them. Click on download for the asset you want.

    5. Once downloaded, you will see the button turn to the word import. At this point you can import your new asset. KEEP IN MIND: Depending on the asset, your project may have things overwritten or other may import unnecessary items. Always check what is being imported by reading the import window that shows up.

    You should now see the asset inside of Unity ready to be used. For instructions on using assets, check with the instructions provided by the asset provider whom you purchased the asset from.

    Enjoy and God Bless!

    Nav
     
  5. gamescorpion

    gamescorpion

    Joined:
    Feb 15, 2014
    Posts:
    132
    ISSUE: What the hell is MVVM?!

    OUR SOLUTION:
    After researching for hours on the web, I finally came up with what I believe is correct, but I may be wrong (If I am, please let me know what is right, but this is what I got from all the research thus far):

    WHAT THE HELL IS MVVM?!

    MVVM stands for Model View View-Model...but WHAT DOES IT MEAN?!

    For a FORMAL definition (That will confuse the heck out of you unless you are super hardcore developer, and dude I'm a computer science grad and it boggles my mind, so don't sweat it): http://en.wikipedia.org/wiki/Model_View_ViewModel

    For a Noob/Layman's version:
    a. View: This is the stuff that the player sees on the screen, including your graphics and user interface controls. Ex. The score, a button, etc.
    b. View-Model: This is the ACTIONS that take place WHEN a user interacts with the stuff in your views. Ex. Player hits a button, a View-Model will handle what happens next.
    c. Model: Is literally the definition of an object or the physical data (like a database). For example, a Contact in your address book may consist of a first name, last name, phone number. That would be an object. OR a simple database with data to pull from.
    DATA-BINDING: This is literally what makes the MVVM stuff work.

    Okay so now an even more simple explanation:
    Lets say I need to make a powerpoint presentation showing how many males vs females you have in your phonebook (That's our VIEW - The powerpoint presentation)
    I ask you to go and hire someone to make us a list from your phonebook that splits up the total amount of phone numbers between males and females (The actual process of grabbing and organizing the data and running commands and stuff on the data would be the VIEW MODEL)
    In order to actually get started, our hired employee needs the actual phonebook that has the data (That's our MODEL)

    Now, the actual phonebook doesn't care WHO uses the data and is unaware who the hell is opening the book. (The MODEL does not know the VIEW-MODEL exists)
    The same way, the hired staff member who creates the data and outputs the final results, doesn't know or even care how the results will be shown to people (The VIEW-MODEL does not know that the VIEW exists)
    So in this way, you could present the data using any view you wanted, such as in a powerpoint presentation today, and maybe in a website article the next day.

    What this literally does is allows people to focus on the three separate layers induvidually and focus only on those specific areas. One of the great strengths of MVVM is the capability of REUSING code and many other things as well.

    Please let me know if there is anything incorrect here or a better way to explain this as I myself am still learning this.

    Thanks and God Bless!

    Nav
     
    Last edited: Aug 6, 2014
  6. gamescorpion

    gamescorpion

    Joined:
    Feb 15, 2014
    Posts:
    132
    ISSUE: Why is my CoRoutine not working??

    SOLUTION:
    Always make sure to put any coroutine functions into a StartCoroutine(YourCoroutine());

    ALSO Make sure that your function is of type IENUMERATOR!

    :) Please refer to Unity docs for further info on CoRoutines. These are great for timers or waiting.

    Enjoy!

    Nav
     
  7. gamescorpion

    gamescorpion

    Joined:
    Feb 15, 2014
    Posts:
    132
    ISSUE: I need a dynamic music generator or music sequencer script

    OUR SOLUTION:
    While messing around learning about music I created a cool script below in C# which will take ANY SOUND and turn it into music which you can pre-program! (Take it and tweak to your liking, just leave the info at the top so others know whats going on and who did what etc.):

    TIP: Attach any melodic instrument sound in wav format to an object, then attach this script and press the letter "R" on your keyboard and it will play Pachbel's Canon in D (Take a look at it to understand how to make your own music with it)

    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4.  
    5. public class AutoMusicGenerator : MonoBehaviour {
    6.  
    7.   /*
    8.   Auto Music Generator
    9.   ====================
    10.   Main Code By:
    11.   Abhinav Gupta
    12.   Game Scorpion Inc.
    13.   www.GameScorpion.com
    14.   Version: 1.0.0
    15.   Date Created: November 13th, 2014
    16.   Date Last Updated: November 13th, 2014
    17.  
    18.   Basic Concept Code Base from:
    19.   http://answers.unity3d.com/questions/141771/whats-a-good-way-to-do-dynamically-generated-music.html
    20.  
    21.   HOW TO USE:
    22.   1. Create an empty Game Object
    23.   2. Click and drag any audio wav file (non 3D sound) to the object
    24.   3. Click and drag AutoMusicGenerator.cs onto Object
    25.   4. Call function from Anywhere in your code using the following format:
    26.  
    27.   // Where bLoop = true means song will loop (False by default)
    28.   // sNotes is a string as outlined in the below explanation
    29.   // fTime is a floating point number that denotes the music beat time (Ex. 100 bpm is default)
    30.   GenerateSong(bool bLoop, string sNotes, float fTime);
    31.  
    32.   TO FORM A NEW SONG (sNotes String):
    33.   Choose a note and a scale:
    34.   Example: C4, D3, C5, etc.
    35.  
    36.   Follow each note by a comma and then the time in beats (Where 2 = 1 Beat on sheet paper. 1 = 1/2 Beat on sheet paper):
    37.   C4,4,D5 = Play note C4, then wait 4 beats then play D5
    38.  
    39.   FLAT NOTES:
    40.   Put the letter "f" next to any note to show it is flat:
    41.   C4f,1,D5f,2 = Play C4 Flat, wait 1/2 beat, Play D5 Flat, wait 1 beats
    42.  
    43.   SHARP NOTES:
    44.   Simply calculate what the FLAT note equivalent would be by going up one note.
    45.   Ex. C# = D Flat
    46.  
    47.   CURRENT RANGE: C3 to D5
    48.   NOTE: C4 Note = THE BASE 0 NOTE which means that your sound will originally sound like this and will be adjusted from this point
    49.  
    50.   */
    51.  
    52.   // Public Variables FOR ADJUSTMENT BY DEVELOPER
    53.   public float fBeatAdjustment = 0.1f;
    54.  
    55.   // Public Variables not required to adjust but useful for access by other methods
    56.   public float fMusicTime = 50.0f;
    57.   public bool bLoopMusic = false;
    58.   public string sNextNoteToPlay = "";
    59.   public float fNextBeatToPlay = 0.0f;
    60.   public string sOriginalSong = "";
    61.   public string sPlayingSong = "";
    62.   public bool bPlaying = false;
    63.   public float fCurrentBeat = 0.0f;
    64.   private bool bNextNote = false;
    65.  
    66.   float transpose = -4.0f; // transpose in semitones
    67.   void Update()
    68.   {
    69.   if (Input.GetKeyDown("r"))
    70.   {
    71.   // Force a song to play
    72.  
    73.   // Set Base Values
    74.   bLoopMusic = true;
    75.   sOriginalSong = "G4f,8,E4,8,D4,8,D4f,8,B3,8,A3,8,B3,8,D4f,8";
    76.   sPlayingSong = sOriginalSong;
    77.   fMusicTime = 100.0f;
    78.   bPlaying = true;
    79.  
    80.   }
    81.  
    82.   // Until Note Complete is NOT marked, keep playing note
    83.   fCurrentBeat += 0.01f * fBeatAdjustment * fMusicTime;
    84.   //Debug.Log("Current Beat: " + fCurrentBeat);
    85.  
    86.   // RESET SONG if Loop is enabled
    87.   if (bLoopMusic == true && sPlayingSong.Length <= 0)
    88.   {
    89.   sPlayingSong = sOriginalSong;
    90.   bPlaying = true;
    91.   }
    92.  
    93.   // Check if the beat is completed
    94.   if (fCurrentBeat >= fNextBeatToPlay || fNextBeatToPlay <= 0.0f)
    95.   {
    96.   // Reset Current Beat
    97.   fCurrentBeat = 0.0f;
    98.   bNextNote = false;
    99.  
    100.   // Remove a note from the notes list and place into sNextNoteToPlay
    101.  
    102.   // Get split character used to split string array of notes
    103.   char[] SplitChar = { ',' };
    104.   // Place notes into a temp string array
    105.   string[] tempString = null;
    106.   tempString = sPlayingSong.Split(SplitChar);
    107.  
    108.   if (tempString.Length > 0)
    109.   {
    110.   if (tempString[0] != null)
    111.   {
    112.   // Add This Note To Next Note To Play
    113.   sNextNoteToPlay = tempString[0];
    114.  
    115.   if (tempString[0] == "")
    116.   {
    117.   // There are no more notes to play, reset string and start over
    118.   sPlayingSong = "";
    119.   sNextNoteToPlay = "";
    120.   }
    121.   }
    122.   if (tempString.Length > 1)
    123.   {
    124.   if (tempString[1] != null && tempString[1] != "")
    125.   {
    126.   // Remove a beat from the notes list and place into fNextBeatToPlay
    127.   fNextBeatToPlay = (float)int.Parse(tempString[1]);
    128.   }
    129.   if (tempString[1] == "")
    130.   {
    131.   // There are no more notes to play, reset string and start over
    132.   sPlayingSong = "";
    133.   sNextNoteToPlay = "";
    134.   }
    135.   }
    136.   }
    137.  
    138.   // Reset sPlayingSong string
    139.   sPlayingSong = "";
    140.  
    141.   // Go through notes and replace into sPlayingSong by removing by two
    142.   for (int t = 2; t < tempString.Length; t++)
    143.   {
    144.   // Replace sPlayingSong with new string WITHOUT the note that was removed
    145.   // Add Each Item Back Into String with a Comma
    146.   sPlayingSong += tempString[t]+",";
    147.   }
    148.  
    149.   }
    150.  
    151.   // Based on fMusicTime, play note
    152.   float note = -1.0f; // invalid value to detect when note is pressed
    153.  
    154.   if (sNextNoteToPlay == "C2") note = -24; // C3
    155.   if (sNextNoteToPlay == "D2f") note = -23; // D2f
    156.   if (sNextNoteToPlay == "D2") note = -22; // D2
    157.   if (sNextNoteToPlay == "E2f") note = -21; // E2f
    158.   if (sNextNoteToPlay == "E2") note = -20; // E2
    159.   if (sNextNoteToPlay == "F2") note = -19; // F2
    160.   if (sNextNoteToPlay == "G2f") note = -18; // G2f
    161.   if (sNextNoteToPlay == "G2") note = -17; // G2
    162.   if (sNextNoteToPlay == "A2f") note = -16; // A2f
    163.   if (sNextNoteToPlay == "A2") note = -15; // A2
    164.   if (sNextNoteToPlay == "B2f") note = -14; // B2f
    165.   if (sNextNoteToPlay == "B2") note = -13; // B2
    166.   if (sNextNoteToPlay == "C3") note = -12; // C3
    167.   if (sNextNoteToPlay == "D3f") note = -11; // D3f
    168.   if (sNextNoteToPlay == "D3") note = -10; // D3
    169.   if (sNextNoteToPlay == "E3f") note = -9; // E3f
    170.   if (sNextNoteToPlay == "E3") note = -8; // E3
    171.   if (sNextNoteToPlay == "F3") note = -7; // F3
    172.   if (sNextNoteToPlay == "G3f") note = -6; // G3f
    173.   if (sNextNoteToPlay == "G3") note = -5; // G3
    174.   if (sNextNoteToPlay == "A3f") note = -4; // A3f
    175.   if (sNextNoteToPlay == "A3") note = -3; // A3
    176.   if (sNextNoteToPlay == "B3f") note = -2; // B3f
    177.   if (sNextNoteToPlay == "B3") note = -1; // B3
    178.   if (sNextNoteToPlay == "C4") note = 0; // C4
    179.   if (sNextNoteToPlay == "D4f") note = 1; // D4f
    180.   if (sNextNoteToPlay == "D4") note = 2; // D4
    181.   if (sNextNoteToPlay == "E4f") note = 3; // E4f
    182.   if (sNextNoteToPlay == "E4") note = 4; // E4
    183.   if (sNextNoteToPlay == "F4") note = 5; // F4
    184.   if (sNextNoteToPlay == "G4f") note = 6; // G4f
    185.   if (sNextNoteToPlay == "G4") note = 7; // G4
    186.   if (sNextNoteToPlay == "A4f") note = 8; // A4f
    187.   if (sNextNoteToPlay == "A4") note = 9; // A4
    188.   if (sNextNoteToPlay == "B4f") note = 10; // B4f
    189.   if (sNextNoteToPlay == "B4") note = 11; // B4
    190.   if (sNextNoteToPlay == "C5") note = 12; // C5
    191.   if (sNextNoteToPlay == "D5f") note = 13; // D5f
    192.   if (sNextNoteToPlay == "D5") note = 14; // D5
    193.  
    194.   if (bPlaying == true && bNextNote == false && sNextNoteToPlay != "")
    195.   {
    196.   audio.pitch = Mathf.Pow(2, (note + transpose) / 12.0f);
    197.   audio.Play();
    198.   bNextNote = true;
    199.   }
    200.   else if (sNextNoteToPlay == "")
    201.   {
    202.   sPlayingSong = "";
    203.   fNextBeatToPlay = 0.0f;
    204.   }
    205.  
    206.  
    207.   }
    208.  
    209.   public void GenerateSong(bool bLoop, string sNotes, float fTime)
    210.   {
    211.   // Set Base Values
    212.   bLoopMusic = bLoop;
    213.   sOriginalSong = sNotes;
    214.   sPlayingSong = sNotes;
    215.   fMusicTime = fTime;
    216.   bPlaying = true;
    217.   }
    218.  
    219. }
    220.  
    221.  
    ENJOY and God Bless!

    Nav
     

    Attached Files:

  8. gamescorpion

    gamescorpion

    Joined:
    Feb 15, 2014
    Posts:
    132
    ISSUE: While importing an asset I get the following error message: "Error while importing package: Couldn't decompress package"

    OUR SOLUTION:
    So I found an alternative way to decompress pacakages after download (I think this error happens with large files or large assets). Anyways here is the solution that worked for me and will hopefully work for you as well.

    1. Navigate to the actual pacakge file on your hard drive (Open Windows Explorer->Navigate to C:\Users\<USERNAME>\AppData\Roaming\Unity\Asset Store\<Name of Company>\Package)

    2. Double click directly on the package and it should now import into Unity correctly.

    Hope this helped others out there :)

    God Bless!

    Nav
     
  9. gamescorpion

    gamescorpion

    Joined:
    Feb 15, 2014
    Posts:
    132
    ISSUE: I get this error all of a sudden => NullReferenceException: Object reference not set to an instance of an object

    OUR SOLUTION:
    Weird as it may be, there are many reasons WHY you get this error when coding in C#, however if you JUST got this error, try simply RESTARTING UNITY! Yes it does work in some cases, and I've had that happen to me several times where a simple restart of unity actually fixes this error. Try it out and see if that works for you. If not, then check the script that the log is referencing for more information, but before I do that I usually give Unity a good little reboot just to save myself possibly hours of finding what I like to call a possible "ghost bug". 1 min of a Unity restart could save you hours if its something as simple as one of these Ghost Bugs.

    Enjoy and God Bless!

    Nav
     
  10. gamescorpion

    gamescorpion

    Joined:
    Feb 15, 2014
    Posts:
    132
    ISSUE: GUI Texture (NGUI) wont allow me to change x, y, z position (translation) in Inspector

    OUR SOLUTION:
    1. Go into Inspector down to Anchors
    2. Change Anchors from Unified to None
    3. Go up to Position and Make the changes you want in the x,y,z postion
    4. Go back down to Anchors and reset to Unified.

    ENJOY!

    Nav
     
  11. gamescorpion

    gamescorpion

    Joined:
    Feb 15, 2014
    Posts:
    132
    ISSUE: Using Unibill getting weird erorr message as follows: NullReferenceException: Object reference not set to an instance of an object. Getting the message every time I try and open the editor window and Unity seems to freeze and wont let me click anything!

    OUR SOLUTION:
    Firstly to be able to click again, change your VIEW in the TOP RIGHT of the Unity screen next to the "Layers" drop down, change the view to any other view (Ex. Default, 2 by 3, etc.).

    I think I must have done something to bugger up the JSON files that made the bug occur, but here is the fix (and yes you have to redo your store entries again afterwards):

    1. Open your JSON file located at Assets/Plugins/unibill/resources/unibillInventory.json
    2. Copy and Paste the data of the JSON file into notepad (Just open up notepad on the side)
    3. Now delete ALL Unibill items (We are going to REIMPORT Unibill fresh again):
    Plugins/unibill
    Plugins/Uniject
    Plugins/uniillosx.bundle
    Assets/Editor/unibill
    (And go through to find any other items connected to Unibill in Project Window)
    4. Re-Import Unibill asset from the asset store
    5. Next once successfully imported, open up the editor (Window=>Unibill=>Inventory Editor)
    6. Save an empty copy by deleting all items in the editor (I saved Google, Amazon and Samsung JSON files when I did it)
    7. Now open up the JSON file located at Assets/Plugins/unibill/resources/unibillInventory.json
    8. Now go to your Notepad and COPY AND PASTE the previous data back into the file and resave
    9. Now you should be up and running again with Unibill

    STILL NOT WORKING?
    I'd recommend emailing the Unibill support directly => support@outlinegames.com

    I even had to re-import the entire UniBill asset again. It can be a bit frustrating, so hopefully it works out for you :)

    ENJOY!

    Nav
     
    Last edited: Dec 1, 2014
  12. gamescorpion

    gamescorpion

    Joined:
    Feb 15, 2014
    Posts:
    132
    ISSUE: Tips for dealing with file i/o and multiple scripts

    OUR SOLUTION:

    Okay so you're new to file i/o just like I am, great!

    Here is a few tips that will get you going which caused me hours of noob time spent banging my head only to realize how much of a noob I was...ENJOY:

    1. When working with file i/o it's always good to use a SINGLE object rather than a script in a scene to access file i/o. The reason for this is that if you have too many scripts all loading their own INSTANCES (These are separate loads) of a File I/O script, you'll end up saving things in one script only to have them NOT be saved and loaded correctly in another.

    The most simple way I can explain this is think about working at a company. You have a message you want to tell everyone via email. Now instead of sending a SINGLE email, you send every single person an email manually one by one which you write by hand. In a few of the emails you put a message which you think EVERYONE else got as well, but when you ask others, they did not get the message at all because you created SO MANY EMAILS! This could have all been avoided if you had ONE single email sent to everyone and everyone got the same message without confusion.

    Hope that kinda gives you an idea of why you want to access File I/O via an object in a scene rather than creating new instances of a File I/O script in code.

    2. For a more secure File I/O system instead of using PlayerPrefs, please visit this amazing video:


    ENJOY!

    Nav
     
  13. gamescorpion

    gamescorpion

    Joined:
    Feb 15, 2014
    Posts:
    132
    ISSUE: Super simple PHP connection from within Unity 3D

    OUR SOLUTION:

    References: http://stdioe.blogspot.ca/2014/03/sending-data-to-mysql-database-using.html



    Okay so here is my version (thanks to the helpful tutorials above) for a NOOB simple step by step to do a quick connection to a PHP script (And then from there you can easily access things like MySQL, etc., but the biggest challenge is trying to figure out a SIMPLE step by step on how to do this!)

    1. Create an empty C# script (For example PHPExample.cs)
    2. Okay, now Copy and Paste the following into the script and make sure you place the file on an object in your scene. If you want, here is a COMPLETE file for Unity:
    Code (csharp):
    1.  
    2.   public string message;
    3.  
    4.   void Start()
    5.   {
    6.      WWWForm form = new WWWForm();
    7.       form.AddField("action", "send");
    8.       form.AddField("id", "1");
    9.       WWW w = new WWW("http://www.YourWebsite.com/YourScript.php", form);
    10.       StartCoroutine(register(w));
    11.   }
    12.  
    13.   IEnumerator register (WWW w)
    14.   {
    15.       yield return w;
    16.       if (w.error == null)
    17.       {
    18.           // Received Message
    19.           message += w.text;
    20.       }
    21.       else
    22.       {
    23.           message += "ERROR: " + w.error + "\n";
    24.       }
    25.       Debug.Log("MESSAGE: " + message);
    26.   }
    27.  
    3. Now create the PHP file which you will keep on your server as follows:
    Code (csharp):
    1.  
    2. <?php
    3. if ($_REQUEST['action'] == "send")
    4. {
    5.      echo "ID - ".$_REQUEST['id']." Sent Action";
    6. }
    7. else
    8. {
    9.    echo "Unsent Action";
    10. }
    11. ?>
    12.  
    4. Save the php file as YourScript.php and upload to your server

    5. Run the program in Unity and check the log messages. You should clearly see in your log the following:

    MESSAGE: ID - 1 Sent Action

    6. Now from this basic example you can read over the references and expand as you wish :)

    ENJOY!!!

    God Bless!

    Nav
     
  14. Gametyme

    Gametyme

    Joined:
    May 7, 2014
    Posts:
    618
     
  15. Gametyme

    Gametyme

    Joined:
    May 7, 2014
    Posts:
    618
    Issue: how to setup mobile controlls?
     
  16. gamescorpion

    gamescorpion

    Joined:
    Feb 15, 2014
    Posts:
    132
    Hey Gametyme,

    When you're asking about mobile controls, are you asking about touching on the touchscreen or keyboard input using the virtual keyboard or a DPAD/VPAD?

    I personally use the EasyTouch asset from the asset store myself which is cross platform and works for me, but it does have a learning curve though. There are several other input tools on the Asset store, some which are free others which are paid. You may even be able to find several solutions and tutorials online on this.

    Hope that gives you a step in the right direction :)

    God Bless!

    Nav
     
  17. Gametyme

    Gametyme

    Joined:
    May 7, 2014
    Posts:
    618
    Yes, d pad and buttons. I purchased control freak but it hasn't been updated for use with unity 4.6. Thanks.
     
  18. gamescorpion

    gamescorpion

    Joined:
    Feb 15, 2014
    Posts:
    132
    I've found the EasyTouch package has helped me out a lot and they even have DPad stuff in it too. Take a look and see if it helps you out as well => https://www.assetstore.unity3d.com/en/#!/content/3322

    PS: It's on sale right now at the time of writing this :)

    Nav
     
  19. Gametyme

    Gametyme

    Joined:
    May 7, 2014
    Posts:
    618
    Thanks I'll check it out.
     
  20. gamescorpion

    gamescorpion

    Joined:
    Feb 15, 2014
    Posts:
    132
    ISSUE: How do you port your game from Unity to iOS (Apple App Store)?

    OUR SOLUTION:
    Here is the best solution offered directly by Unity! Check it out!


    Enjoy!

    Nav
     
  21. gamescorpion

    gamescorpion

    Joined:
    Feb 15, 2014
    Posts:
    132
    ISSUE: I get an error about JIT when compiling for iOS using BinaryFormatter => "ExecutionEngineException: Attempting to JIT compile method 'Serializer__TypeMetadata:.ctor ()' while running with --aot-only"

    OUR SOLUTION:

    Reference: http://answers.unity3d.com/questions/30930/why-did-my-binaryserialzer-stop-working.html

    1. Simply add the following line of code to your Awake() function:
    Code (csharp):
    1.  
    2. Environment.SetEnvironmentVariable("MONO_REFLECTION_SERIALIZER","yes");
    3.  
    God Bless!

    Nav
     
  22. gamescorpion

    gamescorpion

    Joined:
    Feb 15, 2014
    Posts:
    132
    ISSUE: OpenURL not working on iOS

    OUR SOLUTION:

    Make sure your web address STARTS with http:// and has NO SPACES (Replace every space with %20):

    Ex.
    Code (csharp):
    1.  
    2. "www.ArmiesOfRiddle.com/p=Hello World" <== THIS WILL FAIL
    3. "http://www.ArmiesOfRiddle.com/p=Hello%20World" <== THIS WILL WORK
    4.  
    Enjoy!

    Nav
     
  23. gamescorpion

    gamescorpion

    Joined:
    Feb 15, 2014
    Posts:
    132
    ISSUE: iTween oncomplete is not working...whats going on?

    OUR SOLUTION:
    Most likely the issue is that you are calling the oncomplete function for an object that DOES NOT have the script with the function you want attached to it.

    EXAMPLE:
    OBJECT A - Has the script with the function on it
    OBJECT B - This is the object you are running the iTween on FROM Object A, however it does NOT have the script with the function on it.

    iTween.PunchRotation(OBJECT_B, iTween.Hash("amount", new Vector3(0.0f, 720.0f, 0.0f), "time", 1.0f, "oncomplete", "MyFunctionInsideScriptAttachedToObjectA"));

    SO the solution would be to add a SIMPLE set of keys to your iTween.Hash which is the TARGET. Simply make the following change:

    iTween.PunchRotation(OBJECT_B, iTween.Hash("amount", new Vector3(0.0f, 720.0f, 0.0f), "time", 1.0f, "oncomplete", "MyFunctionInsideScriptAttachedToObjectA", "oncompletetarget", gameObject));

    That should fix your issue and everything should work now.

    ENJOY and God Bless!

    Nav
     
  24. gamescorpion

    gamescorpion

    Joined:
    Feb 15, 2014
    Posts:
    132
    ISSUE: You get the error: " error CS0101: The namespace `global::' already contains a definition for ________"

    OUR SOLUTION:
    This message basically means that you have another script file with the EXACT same name as its class name. Unity (from what I've learnt via coding myself) only allows only one of a kind classes, kinda like a fingerprint. It's unique to that script and no other script can share it.

    To FIX this issue, simply change the name of the class in the script you are trying to import. However keep in mind that it can break your entire program by doing so. If you can contact the original developer, that may be a better solution to see if they have a fix for you. However since we know that there are some code assets that are no longer updated (but can be highly useful), you can attempt the fix above on your own. Remember, before doing any changes always make a backup.

    ENJOY!

    Nav
     
  25. gamescorpion

    gamescorpion

    Joined:
    Feb 15, 2014
    Posts:
    132
    ISSUE: How do you get a public external IP for a player?

    OUR SOLUTION:
    This is a HACK solution that DOES work. I've tried all the methods and then just lost my mind when I started reading more networking details and terms like NAT and stuff...LIKE AS IF I DONT ALREADY HAVE ENOUGH ACRONYMS to figure out lol!

    To do this you will require:
    1. Your own web server which has PHP capabilities

    STEP 1:
    1. Inside of unity, create a new C# script and add the following functions as follows:

    Code (csharp):
    1.  
    2. public void FindPublicIP()
    3. {
    4.   // Get Public IP - note: Change MYSERVER to your own domain name where you store the php file
    5.   WWWForm form = new WWWForm();
    6.   WWW w = new WWW("http://www.MYSERVER.com/return_public_ip.php", form);
    7.  
    8.   StartCoroutine(public_ip_request(w));
    9. }
    10.  
    11. IEnumerator public_ip_request(WWW w)
    12.   {
    13.   string message = "";
    14.   yield return w;
    15.   if (w.error == null)
    16.   {
    17.   // Received Message
    18.   message += w.text;
    19.   }
    20.   else
    21.   {
    22.   message += "ERROR: " + w.error + "\n";
    23.   }
    24.  
    25.   Debug.Log("PUBLIC IP: " + message);
    26. }
    27.  
    2. Now open up notepad and copy and paste the following code and SAVE THE FILE AS A PHP FILE CALLED: "return_public_ip.php"

    Code (csharp):
    1.  
    2. <?php
    3.    echo $_SERVER['REMOTE_ADDR'];
    4. ?>
    5.  
    3. Now upload the PHP file to your server and simply call the FindPublicIP function from anywhere in your code. Then Run the code. INSIDE YOUR LOG WINDOW you should end up seeing your PUBLIC IP address.

    NOTE: This hack works, however there are ways to go around the IP address and I'm sure that NAT stuff is much more better, however for a SIMPLE solution (Especially if you're like me and just need to figure out the public IP for a simple P2P game, then this is a simple yet dirty solution). WARNING: Use this solution at your own risk, I take no responsibility if you use it, I'm just another developer who stumbled upon this dirty hack myself via tireless google searches and getting UNASSIGNED errors and finally just using this dirty solution which ended up working.

    Hope this helps someone out :)

    God Bless!

    Nav
     
  26. gamescorpion

    gamescorpion

    Joined:
    Feb 15, 2014
    Posts:
    132
    ISSUE: Build Export Failed (Noob Mistake)

    OUR SOLUTION:

    I have done this on many occasions and its such a noob mistake, but I share it here for those who have not seen it or have forgotten it.

    Sometimes when you get an error on your build using Build Settings while exporting, you may have actually been really excited and hit the build button FASTER than Unity Compiling your CURRENT CODE.

    This has happened to me several times, and then you get weird errors and bugs, but its just Unity going crazy because you're trying to do a main compile before it finishes compiling your mono code.

    HOW DO YOU AVOID THIS?

    Before you actually hit the build button, look at the BOTTOM RIGHT CORNER and you will see a spinning circle. That circle tells you Unity is compiling your current script. If you MAKE SURE to only hit the build button AFTER this circle dissappears, you'll get a proper build (or proper real errors). Whatever you do, make sure that you do NOT edit your code if you simply were too early in pressing build. I've spent hours on that before only to realize that Unity had not fully built the solution and I was going on a wild goose chase in GOOD code looking for a ghost bug that didnt exist LOL!

    Such a noob mistake, but it still happens from time to time.

    Bottom Line: ALWAYS MAKE SURE YOUR CODE IS COMPILED FIRST before hitting build!

    God Bless!

    Nav
     
  27. gamescorpion

    gamescorpion

    Joined:
    Feb 15, 2014
    Posts:
    132
    ISSUE: I don't have thousands to spend in the Asset Store...any recommendations on assets?

    OUR SOLUTION:

    Okay after using Unity for a year and a half and now spending thousands of dollars myself on assets, I've gone through the whole "Man why the hell did I buy that asset" to the, "I can't live without this thing, it should have been built into Unity, it's incredible" and everything in between.

    Here is my personal list of PAID assets which in my own opinion worth their weight in gold! Just the time you'll save by using some of these assets is WELL worth the price!

    LAST UPDATED (28-May-2015):

    UniBill (https://www.assetstore.unity3d.com/en/#!/content/5767)

    I can't say ENOUGH about this thing! I use to code In-App purchases BY HAND in every platform before so I know how bloody long IAP takes! I use to do it personally in Objective-C (iOS) and Java Eclipse (Android), and I had to do all the callbacks by hand, etc. Seriously this solution nearly made me shed a tear as to how much time and hell it saved me! What took me weeks and months to code and test was now instantly working CROSS PLATFORM with a very simple integration. This should be in EVERY Unity developers hands and is worth the money. If you're doing any form of In-App purchases in your games, then you NEED THIS!

    NGUI (https://www.assetstore.unity3d.com/en/#!/content/2413)
    Yes even though the new Unity GUI exists, this is still my favorite GUI implementation. Trust me, once you learn how to use it, it becomes the bread and butter of your HUDs. There are a lot of tutorials and support for this tool and always an answer somewhere via a google search if you ever have any questions. This is the tool used by most developers for GUI and I use it daily as well.

    FLUX (https://www.assetstore.unity3d.com/en/#!/content/18440)
    I have purchased many cinematics tools before, but Flux in my opinion is the most simple solution that just gets the job done easily and fast. It's a no nonsense solution that is not as cluttered or as fancy as other solutions and really easy to pickup when you're just starting out. I use this daily as well for all my cinematics. I purchased the other major ones as well which are really powerful and are also recommended (Like Cinema Director, really solid solution, one step up from Flux imo, but requires a learning curve). Flux came in as my daily tool for cinematics and other movie style movement because its simple and gets the job done.

    Internet Reachability Verifier (https://www.assetstore.unity3d.com/en/#!/content/19009)
    IRV is seriously an awesome tool that will always let you know when there is a proper internet connection. For those of you making multiplayer games or even just trying to make sure that users have internet access, then this one is a must have tool. With a few simple lines of code you can check to see if TRUE internet is available (which is a false positive with the built in Unity code I find in general). Check this tool out if you have any requirements for internet access in your games.

    Easy Touch (https://www.assetstore.unity3d.com/en/#!/content/3322)
    Oh where in the world of Unity would I be without this magnificent asset!? Seriously a daily use tool and allows me to easily put touch into all my games. Any object I can think of can become touchable! There is a bit of a learning curve but once you learn how to use this tool, it becomes a very powerful tool that you'll use all the time! I highly recommend it for sure!

    ELAN Easy Local Android Notifications (https://www.assetstore.unity3d.com/en/#!/content/9484)
    This may take a bit of time to integrate, however once you do its a definite lifesaver in Android and can generate a lot of repeat users and higher retention and monetization! Get it today and save yourself time with Android Local Notifications!

    ====================

    More updates on my favorite tools coming soon!

    Nav
     
    Last edited: May 28, 2015
    SpectralRook likes this.
  28. gamescorpion

    gamescorpion

    Joined:
    Feb 15, 2014
    Posts:
    132
    ISSUE: New iOS 64bit compile. How Do I do this?!

    OUR SOLUTION:
    Okay so starting in Feb. 2015, Apple now requires all apps to be 64bit ready. Apparently Unity 4.6 is now ready for this using their new IL2CPP which means we will be able to compile for the latest Apple requirements.

    IMPORTANT NOTE: Make sure you are using the LATEST version of xCode and are testing on an iOS 8+ device!! Also use the Patch build of 4.6.3p3 (visit http://unity3d.com/unity/qa/patch-releases) because there are errors that are fixed or else your iOS build will fail in xCode. I made this mistake and used an older xCode and a device that was still on iOS 7. It worked but failed in the review process on iOS 8 devices. Before you begin upgrade your xCode and Device to comform with the latest policies (Keep in mind that this may bugger things up so make sure you are prepared for that!!! Unfortunately with this new Apple rule, after Feb 2015, everyone has to conform to this new 64 bit iOS 8 policy so we are left with no choice BUT to upgrade...)


    Here are the steps I have followed (I'll update as I am doing this right now) so far:
    1. Update your MAC Unity to 4.6+ by downloading it onto your system (Inside of Unity check for updates, or visit unity's website and login and download the latest update). NOTE: I personally code everything on PC first and port to Android first, and then I move over to my Mac for iOS specifically. If you also have a similar setup, then at this moment I would not recommend also upgrading your PC systems Unity as this can cause a lot of upgrade issues. Android markets have not got a similar policy in place yet (at the time of writing this) but if you have the time to invest in upgrading that is up to you. I personally dont like wasting time I dont have to (As I've done upgrades in the past so I know that in the worst case scenarios, even a simple upgrade can cost me a month or more of code updates just to fix up the mess an upgrade can do).

    2. Once you have updated, open up Unity again and wait for the asset import (I'm assuming you have already switched the platform to iOS - iPhone, iPod Touch and iPad. If not, do this now, but this may take a long time, took me a solid 24 hours for my game...I should start learning how to use Team Server LOL). After that click on File=>Build Settings=>Player Settings

    3. Now select the 'Other Settings' tab and then make sure you select Configuration=>Scripting Backend=>IL2CPP

    4. Make all the other changes you normally would do with an iOS build and hit Build.

    5. Once built, open up your game inside of xCode. Once in xCode, click on Product=>Scheme=>Edit Scheme

    6. Now change build configuration from Debug to Release.

    6.5. Make sure in the Build Settings tab, you DO NOT build for active architectures when doing a release build, or it will ONLY build for that specific architecture on your device and not ALL the architectures your app can work on. This took me a while to understand, but hopefully this will save someone else some time :)

    7. Compile your game and test on device

    8. NOTES FOR THOSE USING BinaryFormatter for saving!!! This worked fine before when you used the Mono Reflection code in awake before the IL2CPP, however with IL2CPP the only fix for me was on iOS Specifically using PlayerPrefs to save things! Also my networking all worked with the latest 4.6.3 version of Unity so make sure you use that. I know this may require a bit of code rework, but what I did was made an iOS specific if/then statement which allows the code to work on iOS and using the old BinaryFormatter system on Android. I prefer the BF version because it helps protect a bit more against hacking, but the amount of hacking on iOS side compared to android is far less, so it was an issue I was able to live with just to get 64bit code working. Ultimately I hope this gets fixed so I can go back to BinaryFormatter, but for now this is a fix for those who are in my same position using BF for save/load (Convert over to PlayerPrefs saving and loading just for iOS).

    9. PRO TIP: Once you have uploaded your binary to iTunes, CHECK the build by clicking on it directly (It should take you to a screen where it shows you a list of build details). GO DOWN to the Device Requirements section and MAKE SURE that both armv7 and arm64 ARE LISTED!!! IF NOT, YOUR APP WILL BE REJECTED!!! You need both of these as of Feb/2015!!!


    OTHER NOTES: When completed, make sure your BUILD SETTINGS have Supported Platforms changed to iOS from iphoneos AND change the Architectures to Standard architectures. Also make sure the same is true in the main project settings target as well (There are a few targets that are there; the main target, your app, and then some other variant of your app for testing. I just set all 3 of these build settings to the same thing)

    For more information on this topic, please refer to the following links that also helped me:
    http://docs.unity3d.com/Manual/iphone-64bit.html
    http://blogs.unity3d.com/2015/01/29/unity-4-6-2-ios-64-bit-support/
    http://forum.unity3d.com/threads/4-6-ios-64-bit-beta.290551/

    God Bless!

    Nav
     
    Last edited: Mar 22, 2015
  29. gamescorpion

    gamescorpion

    Joined:
    Feb 15, 2014
    Posts:
    132
    ISSUE: Linker Errors in xCode Mach-o error And possible rejection by Apple because app is not working on certain devices.

    OUR SOLUTION:
    I had to learn this the hard way, but basically what it came down to in plain english was that I only built the game for the SPECIFIC device I connected (Which was an armv7 device) and I told xCode to ONLY build the active architecture (Which means that xCode will only build the binary for the device architecture that is plugged in, which in my case was an armv7 device, but it wont build the others). In this case what happened was that when my binary was done and I uploaded to Apple, after a few hours they would auto-reject me because the build would not work on other devices with a different architecture. So to fix this, MAKE SURE your release builds have "Build Active Architecture Only" Set to NO.

    Next, the Mach-o errors I got were because I selected an emulated device (In my case an iPhone 6 simulator rather than a real physical device) and then I would get Mach-o linker errors. To fix that issue I selected a real device that I had and retried the compile and it worked.

    Nav
     
  30. gamescorpion

    gamescorpion

    Joined:
    Feb 15, 2014
    Posts:
    132
    ISSUE: How to setup iOS for Unity on a Mac. First Run setup guide for Noobs (Using latest methods as of March-26th-2015 => My Mac died so i had to reformat and resetup everything from the ground up, figured I'd write it out as a tutorial for other noobs :))

    OUR SOLUTION:

    ASSUMPTION: Before we start, I am assuming you are installing Unity and setting everything up from a FRESH Mac (Literally I am running from a newly formatted drive with the latest OS X Yosemite Version 10.10.2 on a Macbook Air 13 Inch Mid 2009 Model - 1.86 GHz Core 2 Duo with 2GB Ram and 120GB HD)

    ASSUMPTION 2: I'm also assuming you ALREADY have an Apple Developer Account. IF YOU DO NOT, you need to set one up by visiting http://developer.apple.com/programs/start/standard/

    ASSUMPTION 3: You have a PHYSICAL iOS device to test on such as an iPad, iPhone or iPod Touch.

    1. Once you load up your system, open up Safari (Your web browser which looks like a Compass Icon in the bottom list of icons.

    Yes I'm doing this SUPER NOOB friendly for those who are use to PC and have not really used a mac normally)

    MAC NOOB NOTES: On a MAC, the CTRL key from a PC is usually the COMMAND KEY (Looks like a weird flower square icon thing right next to the space bar). Many of the same keyboard shortcuts from windows can be done with it such as copy (CTRL+C = COMMAND+C), paste (CTRL+V = COMMAND+V), select all (CTRL+A = COMMAND+A), etc. Also A RIGHT MOUSE CLICK on a Mac is accomplished by holding down the CONTROL KEY (Usually the second key to the left of the command key) and then clicking the mouse button.

    2. Once safari opens up, go to the top address bar (Just like any browser you've used in the past), and type in the following web address and hit enter/return: http://developer.apple.com

    3. Once there, at the top right, you should see a "Member Center" link, select that

    4. Now it will ask you to login, so go ahead and login to your iOS Developer Account (assuming you already have an Apple Developer Account. If you do not, simply visit http://developer.apple.com/programs/start/standard/ and sign up. It costs $99/year USD to be an Apple App Developer. Make sure you become an iOS app developer and not a Mac app developer. iOS = iPad, iPhone, iPod Touch; Mac App = Mac laptops and desktop apps)

    5. When the page loads, under the "Technical Resources and Tools" section, under "Dev Centers", select the iOS link

    6. As of the time of writing this, the latest OS is iOS 8.2. You should see a link called "Downloads" so go ahead and click on that

    7. Now you should see the link to download the latest Xcode (As of writing this, it is showing up as 6.2). So go ahead and click on "Download Xcode X" (Where X = the version number. In my case 6 at the current moment)

    8. Next you'll be taken to a page that says "Download Xcode for Free". Click on the link below which says "View in the Mac App Store" and then wait a while as the App Store loads up on your mac.

    9. Next when the App Store loads, you should see Xcode and the word "Get" right below the icon for Xcode. Select the Get button which will then turn into a green "Install App" button. Click on it again and it should now ask you for your username and password to download the app. At this point enter in your credentials and let the download start. (NOTE: You may get a message that says "The iTunes Terms and Condditions have changed.", so simply hit OK and follow the instructions. You may have to agree to the terms and then REPEAT this step again as it will send you out of the store again, so simply just click on the link again in the Safari browser and repeat this step and let Xcode download). At this point go take a break as things download as this will take some time as it is at least a few GB! It should now say the word "Installing" on the button you clicked and you should see a little progress bar under the icon for the app store (looks like a little grey rocket ship next to the Safari icon on my system but somewhere on your app bar below).

    <COFFEE BREAK>

    10. While waiting or after you come back to your system, simply open up Safari again, and this time lets start downloading Unity for Mac. Inside of your Safari browser, navigate to https://unity3d.com/get-unity/download

    11. Next, click on the "Choose your unity + download" button and on the next page select your unity version. If you are already a Unity owner, simply scroll to the bottom of that new page where it says you can download unity directly (http://www.unity3d.com/get-unity/update). Alternatively at the time of writing this, I need a PATCH version of Unity to support the new Apple 64 Bit requirements, so Unity 4.6.3p4 is the version of unity I need which I can download from
    https://unity3d.com/unity/qa/patch-releases

    <COFFEE BREAK while downloading Unity (approx. 2 GB) and Xcode is still installing>

    12. Once you have downloaded Unity and Xcode is installed, we must setup your Mac to be able to run iOS apps on a physical device (I'm assuming you have a physical device to test on).

    NEXT MAJOR STEP: Setup of Unity 3D
    =================================
    1. After Unity finishes the download, simply open up the dmg file (Yes on a mac executable/zip (exe/zip) files are called dmg.

    Not exactly sure which one they are as I've had some dmg files open up folders with files, and others that run directly like a program. Anyhoo, the Unity dmg should open up a folder in which you will double click the installation and begin.

    2. Follow the instructions on screen and install Unity (Takes about 5GB Storage)

    3. Once unity is installed, simply double click it to open it up. At this point Unity should ask you for your activation code/serial number, so go and find this and enter it in. (You can also find your licenses here: https://store.unity3d.com/account/licenses)

    4. After activating your version of Unity, enter your unity account email and password or create a new one. After a quick survey, Unity should show a new Project Wizard window. You have now setup Unity, however we want to make sure that the Unity icon stays in the Mac DOCK window. Do a Control+Click on the Unity Icon (That's how your right click on a Mac), and then select Options=>Keep In Dock.

    5. Now lets click on the "Create new Project" button, and simply hit "Create Project" with the default settings (We will just use a quick New Unity Project to setup everything, but you can easily delete this afterwards).

    6. When Unity opens, simply close the Welcome to Unity window and then in the Hierarchy window, click on Create=>3D Object=>Cube. Make sure it looks like a grey square on a blue background simply by changing to the Game view.

    7. Now go ahead and save the scene as "Test" (File=>Save Scene=>Test).

    8. Once saved you should now see the scene in your Assets folder inside of the Project view. Now lets go ahead and click on

    File=>Build Settings and then click the "Add Current" button OR drag the Test scene into the "Scenes In Build" window. NOTE:

    If you make a mistake and add the scene twice, simply remove one scene by clicking on it and hitting the delete button (Which is the same button as backspace on a PC, but unlike a PC I find that it works both as the delete AND backspace button as well).

    9. Next, select iOS from the platform list and then click on the "Switch Platform" button. This should take only a moment as we really dont have anything but a scene to re-import.

    10. Next click on Player Settings button and then in the Inspector window, and enter your Company Name, Product Name and Icon here.

    11. Next click on the Resolution and Presentation section. In this area for now we are not changing anything, but in the future when you are going to release an app, you'd want to change the Orientation. I recommend Auto Rotation in the TWO directions (Or FOUR if your app will work that way) in the main direction of your app. If it is portrait, then you would only check off Portrait and Portrait Upside Down. If it is landscape then you would check off Landscape Right and Landscape Left. Keep in mind that you cannot just have a single position without rotation or else Apple will reject your app.

    12. Next go down to the "Other Settings" tab. You will be updating the identification to com.YourCompany.YourGame and then entering your Bundle Version (corresponds to the Build in Xcode) and your Short Bundle Version (corresponds to the Version in Xcode). NOTE: The BUNDLE version must be incremented every time you upload a new version of your app to apple as a new build. Make sure you enter a correct app bundle or else you will have a challenge in compiling and signing later on.

    Ex: I make an app, then I realize that a button is not working. I fix the button and rebuild the version, however I must INCREMENT the Short Bundle Version by 1 in order for apple to accept it. Okay so NOW THE REALLY IMPORTANT PART as of Feb-2015 => go down to the Configuration section and change the Scripting Backend from Mono (2.x) to IL2CPP.

    13. Okay so now lets go ahead and click on Build in the Build Settings window (Make sure nothing is checked off). Give the build a name (In our case lets just call it Test) and then hit Save. Your app should now be building (this may take a while).

    14. Next open the folder for our app (In our case Test) and then double click on the Unity-iPhone.xcodeproj and this should open up Xcode.

    15. Go through the Xcode setup and after going through the terms, Xcode should install new components.

    16. As Xcode is opening up, at this moment setup Xcode to stay on the Mac app bar below by Control+Clicking on the icon and then selecting Options=>Keep In Dock.

    17. Xcode should now open up to a folder on the left with your project and all other windows empty. Simply click on this project and then click on the Triangle with an Exclamation bar above. This should bring you to a screen that has a bunch of tabs at the top that say => General, Capabilities, Info, Build Settings, Build Phases and Build Rules. Make sure you are in
    the General tab.

    18. You should now see a Yellow Triangle below the Build area saying "No signing identity found".

    NEXT STEPS:
    ===========
    1. Now lets open up Safari again and navigate to http://developer.apple.com and then log into the Member Center

    2. Once you log in, click on Certiicates, Identifiers and Profiles

    3. On the left, under iOS Apps, click on the Certificates Tab

    4. Follow the instructions in the below links to create yourself a set of iOS Certificates and Keys:

    http://www.shiva-engine.com/forum/viewtopic.php?f=27&t=23714&start=70#p48302

    5. Once you have setup your keys, you can now sign your apps. Note that the first time you connect your device and try and build you will be asked to put your Mac into developer mode. MAKE SURE you put it into Developer mode and enter your password. You should be ready to build on your device now.

    6. Now lets test our app simply by connecting your device and hitting Product=>Run

    7. If all goes well, you should now see the cube and the app running on your device. You are now setup to build your games on Mac.

    Enjoy and God Bless!

    Nav
     
    Last edited: Mar 27, 2015
    theANMATOR2b likes this.
  31. gamescorpion

    gamescorpion

    Joined:
    Feb 15, 2014
    Posts:
    132
    ISSUE: Collisions are not being detected...whats going on? I have colliders I have rigid body, why is it not working??

    OUR SOLUTION:
    I went crazy and then felt stupid when I found this solution!
    1. Click on Edit=>Project Settings=>Physics
    2. Make sure that you check off the box that matches in the matrix to the layers you want to have interacting with each other in the physics world.

    Yep thats what fixed the issue for me...feel really silly now...okay bye LOL

    Nav
     
  32. gamescorpion

    gamescorpion

    Joined:
    Feb 15, 2014
    Posts:
    132
    ISSUE: What the heck is a singleton? What does it mean?!

    OUR SOLUTION:
    Yea I'm a developer and there are times where new terms baffle me as well!

    A SINGLETON is a fancy word for => I just need this code to have ONE version of itself in the entire program. (So whether I jump from scene to scene or from one area in my game to another, there should ONLY ever be ONE of this thing ever created).

    To give you an idea of how Unity does stuff right now (If you're totally a noob like I am ;)), every time a new scene is loaded, Unity loads up a whole bunch of objects in the scene (Camera, prefabs, other 3D/2D objects, etc.). Then as you change a scene, unity destroys everything in there and then creates another set of objects for the new scene. Sometimes you may have objects that have the same programming script on it. At that point, if you have TWO objects in a scene which both are using a code to SAVE DATA, you actually have TWO different versions of the same code running as two different objects have their own copy of the code.

    Yea already lost a lot of people there, so lets look at it in noob terms here:

    I have a house which I need to vaccuum. I start off in ROOM 1 and start vaccuuming. When I move to room two, I meet another friend of mine. They have the SAME vaccuum, pretty much an exact replica. Now whatever I collect in my vaccuum, and whatever my friend collects in their vaccuum would be different, however the FUNCTIONALITY of the vaccuum cleaners are the EXACT SAME (They pick up dust). What dust they pickup however would be DIFFERENT.

    SO NOW based on that example, think of each room as a SCENE in unity. When I move from one room to the next, I esentially no longer see anything from the previous room (Unity destroys everything in general, and then creates all new objects for the next scene (Unless you tell it not to)). If TWO objects have the same code, you don't have a single piece of code running, you infact have TWO pieces of the same code running but they can end up doing different things (So think of the two vaccuum cleaners picking up different dust, but having the same functionality). A SINGLETON is when I say to my friend => Hey listen, we are only going to use ONE vaccuum cleaner rather than the two, simply tell me where you see dust and I will pick it up. The same way, in Unity, a Singleton tells everything that this code should ONLY be available once in any given run of the game, from scene to scene or even within a scene, and ALL calls should be made DIRECTLY to this one single piece of code, rather than creating multiple copies of the same code (Hence the multiple vaccuum cleaners) which may have the same functionality but then end up "picking up different dirt" or running the code at different times and on different things.

    For this reason, many people get messed up with unusual issues when multiple versions of a script are running (Think of having like 100 of the same enemy in the scene, etc.). Lets take a file save example, if you have multiple objects trying to use the same copy of a file save code this could be problematic. You are better off having ONE copy of the file saving functionality so you dont get into several objects all trying to save and then you get into the situation where one object deletes something or overwrites an area you just saved because everything is running its OWN version of the code (Or using their own vaccuums instead of everyone just sharing a SINGLE vaccuum).

    Hopefully this gives you a very rough basic overview on what the concept of a singleton is. Ofcourse there is a lot more detail that can go into it, but this in a nutshell is the basic idea.

    Enjoy and God Bless!

    Nav
     
    Last edited: May 7, 2015
  33. gamescorpion

    gamescorpion

    Joined:
    Feb 15, 2014
    Posts:
    132
  34. gamescorpion

    gamescorpion

    Joined:
    Feb 15, 2014
    Posts:
    132
    ISSUE: How to do iOS Local Push Notifications

    OUR SOLUTION:

    Reference Unity Forum (Thanks to everyone who posted and Unity team for the updates and fixes): http://forum.unity3d.com/threads/lo...orking-in-ios-8-unity4-5-4-xcode6-0-1.271487/

    REQUIREMENTS: You need to have Unity 4.6.3p4 or above (As per my testing it is on 4.6.3p4 where I got it all to work successfully)

    NOTE: This solution is up to date as of 28-May-2015 and has been tested successfully on my end.
    NOTE 2: THIS ONLY WORKS FOR iOS and not for Android. For Android I used the ELAN asset successfully and got it up and running. You can find ELAN here => https://www.assetstore.unity3d.com/en/#!/content/9484

    1. FIRST you need to get your app to tell the user that you want to send them local/push notifications. You must do this IMMEDIATELY when you start your app (This is from my own testing). So in my very first scene, the very first line of code I put inside of a Start() function is the following (Which I comment out when building for Android):

    Code (csharp):
    1.  
    2.   // UNCOMMENT OUT FOR iOS ONLY!!!!!
    3.   // Register for notifications if not registered as yet
    4.   NotificationServices.RegisterForLocalNotificationTypes(LocalNotificationType.Alert | LocalNotificationType.Badge);
    5.  
    6.  
    NOTE: The above code will show an alert box to the user after a few clock cycles/game frames to alert them that your app wants to send them push notifications. IF A USER HITS NO, then your app will NOT show any notifications to them, even if you are sending them correctly. Don't make the mistake of hitting NO when you are testing or else you'll think there is something wrong with your code when there isn't. To fix that, just incase you do end up doing that, you must uninstall COMPLETELY your app from the device and start again. I'd recommend uninstalling from the settings section rather than the whole Tap and Hold method as I find tap and hold doesnt completely remove things, but heck thats just me.

    2. Now inside of the start function again on a NEW SCENE (For example Scene 2 which would come after the first scene which initialized the notification services) add the following CLEAR OUT code which clears out previous notifications:

    Code (csharp):
    1.  
    2.  
    3.   // Clear all previous notifications
    4.   NotificationServices.CancelAllLocalNotifications();
    5.   NotificationServices.ClearLocalNotifications();
    6.   LocalNotification setCountNotif = new LocalNotification();
    7.   setCountNotif.fireDate = System.DateTime.Now;
    8.   setCountNotif.applicationIconBadgeNumber = -10000; // Apparently instead of -1, this always works in clearning
    9.   setCountNotif.hasAction = false;
    10.   NotificationServices.ScheduleLocalNotification(setCountNotif);
    11.  
    12.  
    3. NOW after the clearing, you want to put the notification in some function or place where it will be called after at least ONE FRAME after the clearing code (I usually place my code in OnApplicationPause() so I recommend you do the same):

    Code (csharp):
    1.  
    2.   LocalNotification nf_local = new LocalNotification();
    3.   nf_local.fireDate = System.DateTime.Now.AddSeconds(60); // Set a time in seconds to show notification
    4.   nf_local.soundName = LocalNotification.defaultSoundName; // Set Local Notification Sound Name
    5.   nf_local.alertAction = "HELLO"; // This will show up as small text
    6.   nf_local.alertBody = "WORLD"; // This I find will show up as large text or the MAIN message
    7.   nf_local.applicationIconBadgeNumber = 1;
    8.   nf_local.hasAction = true;
    9.   nf_local.repeatInterval = CalendarUnit.Day;
    10.   NotificationServices.ScheduleLocalNotification(nf_local);
    11.  
    4. Now compile and test it out and you should be good to go.

    And there you have it :) Local notifications. You can change things up as that is a standard example to hopefully get you up and running :)

    God Bless!

    Nav
     
  35. gamescorpion

    gamescorpion

    Joined:
    Feb 15, 2014
    Posts:
    132
    ISSUE: How do custom class single dimensional arrays work in C#?

    OUR SOLUTION:

    Yes back to the good old roots! I went through this today as I kept getting intialization errors and stuff inside of Unity and I was banging my head going through the net trying to get someone to just break down exactly what the hell was going on, and then got hit with a "NOOB" hammer to my head LOL!

    Anyways just incase anyone else ever needs a refresher on this here it is:

    CUSTOM CLASS SINGLE DIMENSIONAL ARRAYS IN UNITY:

    1. Create a new Class (Ex. You have a C# script named MyScript.cs)
    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4.  
    5. // My New Class Called MyScript.cs
    6. public class MyScript : MonoBehaviour {
    7.  
    8. }
    9.  
    2. Now create the custom class right ontop. In simple terms a custom class will literally be like your own special variable which holds different things inside of it (All variables inside this class must be public to be accessed), but you can for instance have a variable called Monster and have inside of that all the various items such as power, lives, speed, etc. Another neat thing that Unity does is that if you simply create an EMPTY array of these items as a public variable, it will allow you to DYNAMICALLY create new elements inside of the Inspector Window inside of Unity Editor. I will write out both examples below. Lets start off first by creating the custom class:
    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4.  
    5. // Custom Class
    6. [System.Serializable]
    7. public class MONSTER
    8. {
    9.   public string sNameOfMonster; // What would you like to name the monster?
    10.   public int nTotalLives; // How many lives will the monster have to resurrect?
    11.   public int nTotalPower; // How much power does the monster have before it loses one life?
    12.   // Any other variables you'd like to add to this
    13. }
    14.  
    15. // My New Class Called MyScript.cs
    16. public class MyScript : MonoBehaviour {
    17.  
    18. }
    19.  
    3. Now that we have created a custom class for MONSTER, we need to now initialize it. There are TWO ways we can do this. The first is simply making an empty PUBLIC variable of MONSTER which can then be set inside of the Inspector Window in Unity. The second is initializing it inside of code (can be either public or private). Below are both versions (I will create TWO sets of monsters):
    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4.  
    5. // Custom Class
    6. [System.Serializable]
    7. public class MONSTER
    8. {
    9.   public int nTotalLives; // How many lives will the monster have to resurrect?
    10.   public int nTotalPower; // How much power does the monster have before it loses one life?
    11.   // Any other variables you'd like to add to this
    12. }
    13.  
    14. // My New Class Called MyScript.cs
    15. public class MyScript : MonoBehaviour {
    16.  
    17.   public MONSTER[] enemy_type_1; // This will have monsters of enemy type 1
    18.   public MONSTER[] enemy_type_2; // This will have monsters of enemy type 2
    19.  
    20.   void Start() {
    21.     // Base Initialization of second array (The first one you can set in the Inspector to see the difference)
    22.     int nTotalMonsters = 5; // How many monsters we want to create
    23.     enemy_type_2 = new MONSTER[nTotalMonsters]; // Create a new set of MONSTER variables with 5 elements (0-4)
    24.  
    25.     // NOW we must initialize EACH element in the array!! IMPORTANT STEP or you will get the whole: "object reference not set to an instance of an object" Error
    26.     for (int i = 0; i < nTotalMonsters; i++)
    27.     {
    28.       enemy_type_2[i] = new MONSTER();
    29.     }
    30.  
    31.     // NOW you can finally access each variable element inside the array as follows
    32.     enemey_type_2[0].nTotalLives = 3; // Set the total lives of the first enemy element
    33.     enemey_type_2[0].nTotalPower = 100; // Set the total power of the first enemy element
    34.     enemey_type_2[1].nTotalLives = 2; // Set the total lives of the second enemy element
    35.     enemey_type_2[1].nTotalPower = 90; // Set the total power of the second enemy element
    36.     //.. Etc.
    37.  
    38.   }
    39.  
    40. }
    41.  
    AND there you have it! Now you can create all kinds of cool arrays and build all kinds of neat things :)

    Hope this helped someone else out going through this as well :)

    God Bless!

    Nav
     
    Last edited: Jun 24, 2015
  36. gamescorpion

    gamescorpion

    Joined:
    Feb 15, 2014
    Posts:
    132
    ISSUE: NGUI Error UIPanel.cs

    OUR SOLUTION:

    What worked for me was updating NGUI and then restarting Unity after importing NGUI.

    Try it and see if that works for you as well.

    Nav
     
  37. gamescorpion

    gamescorpion

    Joined:
    Feb 15, 2014
    Posts:
    132
    ISSUE: I would like to document my code or create a document that will store all my functions, methods, etc. kinda like a database or listing of all my C# functions. Is there something like that? How would I do that?

    OUR SOLUTION:

    Okay so basically there is something that is called "Reflection" in C#. That I found really confusing, so I started looking at assets. One asset is available that gives me something close, unfortunately I have Unity 4 and it works in Unity 5 at the moment of writing this. I've emailed the dev to try and get an older copy which hopefully is available. Anyhoo, its called DocMe and it can be purchased from the Unity Asset Store here (https://www.assetstore.unity3d.com/en/#!/content/14436).

    At the time of writing however I couldn't wait for the developer to respond back as I needed something immediately (But I still purchased it because it looks like an amazing asset that I'm sure I'll use as well), I kept googling and landed on this website by Jacob Pennock (http://www.jacobpennock.com/Blog/unity-automatic-documentation-generation-an-editor-plugin/). On his website he describes a tool called Doxygen (http://www.stack.nl/~dimitri/doxygen/download.html) and he even built a free unity asset that allows you to easily import Doxygen into Unity. You can visit his site directly to download his asset and also you can view his tutorial video on the site to import it.

    Here are the steps I followed using Jacob's information and his Unity Package (Please refer to Jacob's site for the download: http://www.jacobpennock.com/Blog/unity-automatic-documentation-generation-an-editor-plugin/):

    1. Download Jacob Pennock's Doxygen Unity Asset
    2. Unzip the file and import into unity (Assets => Import Package => Custom Package)
    3. After importing, click on Window=>Document with Doxygen
    4. (DOXYGEN INSTALL) You'll see a window pop up with an error saying Doxygen is not installed, so lets go ahead and install it:
    a. Visit http://www.stack.nl/~dimitri/doxygen/download.html And then download Doxygen (The easiest setup is going down to the middle of the page and grabbing the windows install)
    b. After downloading, double click on the binary file to start the setup
    c. Once installation is complete, repeat step 3 above and then you'll see the error again, but this time move to step 5 as we now have Doxygen installed and simply need to provide the location.
    5. Click on the SETTINGS/CONFIGURATION tab in the new window that opened up and set the path to Doxygen.exe (For me that was located at: C:/Program Files/doxygen/bin/doxygen.exe)
    6. Next setup the other options including export path and location of scripts as well as version code. NOTE: Make sure you output to a folder OUTSIDE your Assets folder.
    7. Next click on the "Save Configuration" button and when it is done, switch back to the main first tab called Generate Documentation
    8. Next click on "Run Doxygen" and then when it is done, simply click on Browse Documentation.

    And now you should have FULL documentation for your code and classes.

    This is an incredible tool, thank you to Jacob Pennock for making an amazing tutorial and asset for easy integration of this incredible tool called Doxygen!

    Nav
     
    Last edited: Jul 7, 2015
  38. neamerjell

    neamerjell

    Joined:
    Jul 20, 2015
    Posts:
    6
    ISSUE: Its been my lifelong dream to get into game development and that dream just might come true with Unity 5 Personal edition. However, I never was able to get past Algebra II in high school / college and just getting a cube to move around the screen is using concepts like "Vector3" and "Quaternion.Slerp" that are way above my head.

    MY SOLUTION: Google is going to be your best friend for a few days (weeks?)

    Kudos go to forum user BBeck for providing much of this information. All quotes are attributed to him unless otherwise specified.

    Definitions
    Vector: describes a direction in relation to the origin (0,0,0), often represented by 2, 3, or even 4 dimensions
    Quaternion: describes the orientation of an object using a four-dimensional set of data, such as x, y, z, and w - which is often set to a time value
    LERP: Short for Linear Interpolation, a percentage of a distance between two points on a straight line
    SLERP: Short for Spherical Linear Interpolation, a percentage of a distance between two points on the surface of a sphere

    Vectors can be thought of as arrows with the pointy end called the head and the trailing end called the tail.
    "Vectors are always 2 positions: the head which is stored in the Vector object and the tail which doesn't need to be stored because [it's] always at the origin."

    Quaternions represent the orientation of an object in space. "All 3 dimensions of rotation (pitch, yaw, roll) are stored simultaneously in the quaternion."

    "All of the Quaternions used in game programming are a special type of quaternion called a 'unit quaternion'. Their value equals one. By doing that, the quaternion value is forced onto a 3D sphere that is two units in diameter. Because the sphere is 3D, you've 'forced' the quaternion to exist in 3D space with a hidden 4th dimension that makes every possible 3D orientation unique."

    "You should think of quaternions as 'black boxes' that hold rotations. It doesn't matter what happens inside the box. What matters is that you put a rotation/orientation in and you get the correct rotation/orientation out."

    Linear interpolation (LERP) answers the question "How far is x% of the distance between point A and point B which are on a straight line?" Perhaps you've heard of the concept of a weighted average? It's pretty much the same thing. The actual formulas for LERP can get complex, especially when working with more than one axis.

    Spherical Linear Interpolation (SLERP) is similar in function to Linear Interpolation except point A and point B are on the surface of a sphere instead of a straight line. "How far is x% of the distance between two points on the surface of Earth?" You can use SLERP to get the answer. LERP will give you an answer, but it would be somewhere underground or underwater.

    "But when you DO interpolate between two rotational positions, you generally want to use SLERP because LERP is inaccurate. That's because rotations happen on circles, not straight lines."
     
    gamescorpion likes this.
  39. gamescorpion

    gamescorpion

    Joined:
    Feb 15, 2014
    Posts:
    132
    ISSUE: I get a weird android aapt.exe error and unity does not compile! I've tried everything what's going on? Google just isn't helping, and upgrading is not an option. Google Play Services issue. Sample of error: aapt.exe package --auto-add-overlay -v -f -m -j gen -m androidmanifest.xml -s "res" -i

    OUR SOLUTION:
    Okay so after googling like crazy and then even upgrading and about to re-downgrade and going crazy, it came down to the following:

    RE-IMPORT AND RESETUP your various additional sdk's.

    We have several ad sdk's including the Google Play Services sdk. You need to RE-IMPORT and RE-SETUP the google play services sdk again as it probably just didn't compile right the first time. We are using HeyZap, and so what I did was I simply clicked on HeyZap in the main menu above and re-installed the android stuff and BAM it worked on the recompile :)

    Good luck with this issue, I know it drove me bonkers, but plain and simple, reimport and recompile your sdk's.

    Hope this saves some people some heartache!

    Nav
     
  40. gamescorpion

    gamescorpion

    Joined:
    Feb 15, 2014
    Posts:
    132
    ISSUE: Unibill UNIBILL INITIALISE FAILED WITH_CRITICAL_ERROR

    OUR SOLUTION:
    You need to confirm you have the right package/bundle ID inside of your apple developer portal. Simply visit http://developer.apple.com and then check that your package or bundle id matches what you have in your game or app inside of xCode. Most likely you've got a different pacakge name (This happens over time as you use many keys and many apps).

    After confirming you have the bundle id correct in the http://developer.apple.com portal, go to your app and then in the More tab click on About This App and make sure you are also using the correct package/bundle id there.

    If everything checks out, then you may have an error somewhere else.

    For me, this was the issue and thats how I fixed it.

    Hope this helps others :)

    Enjoy!

    Nav
     
  41. gamescorpion

    gamescorpion

    Joined:
    Feb 15, 2014
    Posts:
    132
    ISSUE: I just uploaded a final build to Apple, but I can't see it in the build section!! What's going on!?

    OUR SOLUTION:
    Okay so firstly, you can see your most recently uploaded files inside of your app page in the "Prerelease" tab at the top. This will confirm that you have successfully uploaded your file to Apple.

    Next it can take up to 30 min for Apple to process the file (In my own experience it generally has taken between 5 min at the fastest and up to 1 hour at the latest). After it has been processed, you'll be able to see the build in the build section where you can select it and then submit your game to Apple.

    ENJOY!

    Nav
     
  42. gamescorpion

    gamescorpion

    Joined:
    Feb 15, 2014
    Posts:
    132
    ISSUE: Icon on device comes out blurry, what's the fix?

    OUR SOLUTION:

    What worked for me was changing the IMPORT type of the icon inside of Unity from Compressed (It was RGBA Compressed PVRTC) to Automatic TrueColor and then rebuilding again.

    I think the compression gives that blurry issue, but changing the import type fixed it up for me and hopefully should also fix it for you as well.

    Nav
     
  43. nicholas_neo89

    nicholas_neo89

    Joined:
    Nov 18, 2015
    Posts:
    1
    ISSUE : i am creating a matching card game but i having issue that when I clicked the 2nd cube to reveal it doesn't appear with animation and disappear straight away my question what is the code i have to use to delay the progress so that the player is able to see what is the 2nd cube picture.


    this is my code :
    using UnityEngine;
    using System.Collections;

    public class TileGenerator : MonoBehaviour {

    private int numberOfTiles = 4;
    public GameObject[] tileObjects; //set up variable with a GameObject type
    private RaycastHit hit;
    private GameObject matchOne;
    private string tileName1;
    private string[] tName1;
    private GameObject matchTwo;
    private string tileName2;
    private string[] tName2;
    private bool canClick = true;
    private Vector3[] tileLocations = new Vector3[4]; //Vector is used to declare a position in 3D space
    private int score = 0;
    private string scoreText;
    public float startTime;
    private string currentTime;
    public AudioClip[] audioClip;
    public float delaytimer = 10f;
    float timer;


    GameObject infoGUI;


    void Start ()
    {
    tileLocations [0] = new Vector3 (0f, 0f, 0f);
    tileLocations [1] = new Vector3 (1.5f, 0f, 0f);
    tileLocations [2] = new Vector3 (0f, 1.5f, 0f);
    tileLocations [3] = new Vector3 (1.5f, 1.5f, 0f);

    Camera.main.transform.position = new Vector3 (0.8f, 0.75f, -4.0f);
    for (int i=0; i<numberOfTiles; i++) {
    Instantiate (tileObjects, tileLocations , Quaternion.identity);
    }

    }

    void Update ()
    {
    startTime -= Time.deltaTime;
    currentTime = string.Format ("{0:0.0}", startTime);
    if (canClick == true)
    {
    if (Input.GetButtonDown ("Fire1"))
    {
    Ray ray = Camera.main.ScreenPointToRay (Input.mousePosition);
    if (Physics.Raycast (ray, out hit))
    { //The Collider that was hit. // print ("hit something liao");
    if (matchOne == null)
    {
    revealCardOne ();
    }

    else
    {
    revealCardTwo ();
    }
    }
    }
    }
    }

    void OnGUI()
    {
    scoreText = score.ToString();
    GUI.Label(new Rect (10, 100, 200, 200), scoreText);
    GUI.Label(new Rect (45, 100, 200, 200), currentTime);

    }

    void revealCardOne(){

    matchOne = hit.transform.gameObject;//applies the gameObject that Raycast has collided
    tileName1 = matchOne.transform.parent.name; //assess the name varaible of parent of prefab object
    //print (tileName1);
    if (matchOne == null)
    {
    print ("No object found");
    }
    else
    {
    tName1 = tileName1.Split("_" [0]); //Split() function allows a string to be split into an array of substrings
    print(tName1[0]);
    print ("reveal");
    matchOne.transform.parent.GetComponent<Animation>().Play("spin");
    }
    }

    void revealCardTwo()
    {

    matchTwo = hit.transform.gameObject;
    tileName2 = matchTwo.transform.parent.name;
    //print (tileName2);
    if (matchTwo == null)
    {
    print ("No object found");
    }
    else
    {
    tName2 = tileName2.Split ("_" [0]);
    //print (tName2 [0]);
    matchTwo.transform.parent.GetComponent<Animation>().Play("spin");

    }
    if (tileName1 != tileName2)
    { //check if first tilematches the second - counters clicking same tile twice

    if (tName1 [0] == tName2 [0])
    { //check whether tiles match
    score++;
    PlaySound (0);
    canClick = false;
    Destroy (matchOne); //remove gameObject from the scene
    Destroy (matchTwo);
    canClick = true;
    numberOfTiles = numberOfTiles - 2;
    if (numberOfTiles == 0)
    {
    print ("End Game");
    Application.LoadLevel(0);
    }
    }

    else
    {
    PlaySound(1);
    canClick = false;
    matchOne.transform.parent.GetComponent<Animation>().Play("tHide");
    matchTwo.transform.parent.GetComponent<Animation>().Play("tHide");
    canClick = true;
    }
    matchOne = null;
    matchTwo = null;
    }
    }


    void PlaySound(int clip){
    GetComponent<AudioSource>().clip = audioClip [clip];
    GetComponent<AudioSource>().Play ();
    }
    }
     
  44. gamescorpion

    gamescorpion

    Joined:
    Feb 15, 2014
    Posts:
    132
    Hello Nicolas,

    This post is specifically for solutions to issues, not actually asking for support for issues here. I recommend asking in the main thread or in the unity answers section.

    You can also try and refer to the Unity team directly as i am not affiliated with them, im just another Unity user myself

    Thanks for writing in, and im sure you will find your answer there for sure :)

    Nav
     
  45. gamescorpion

    gamescorpion

    Joined:
    Feb 15, 2014
    Posts:
    132
    ISSUE: What are the Unity 3D 'Magic Folders'?

    OUR SOLUTION:

    In Unity there are special folders which I like to call 'Magic Folders' because they will do something unique when you create them inside of your project within the Project window. I list these below, but if you know of any others PLEASE LET ME KNOW and I will add them here as well.

    Folder Name: Resources (Assets/Resources)
    Magical Properties: When you create this folder inside your Assets folder, every compile you do of an app/game will include ALL items inside this folder! This is useful to know as sometimes you may have certain files which are required by your game or app but are in many other folders. You can easily keep them well organized inside of this special folder and GUARANTEE they will be package with your app/game. Also vice versa, if you are trying to reduce file sizes and you have a Resources folder, you can go through it and simply move unused items OUT of the folder in order to reduce final file size.

    OFFICIAL Unity Manual Special Folders: http://docs.unity3d.com/Manual/SpecialFolders.html
     
    Last edited: Nov 19, 2015
  46. gamescorpion

    gamescorpion

    Joined:
    Feb 15, 2014
    Posts:
    132