Search Unity

2D Infinite Runner Toolkit

Discussion in 'Assets and Asset Store' started by Dreeka, Jun 9, 2013.

  1. Ghostfrog

    Ghostfrog

    Joined:
    Feb 17, 2014
    Posts:
    10
    Dreeka, I am still having issues. I attempted to use the version you sent me and I still don't know where the different scripts go.
    I have an older version of my game that I can start from and delete the "2DInfiniteRunnerToolkit" asset folder from. However, I would then need you to provide me with an appropriate version and instructions as to where each script must go. This is due to the fact that all the game objects like the submarine, overlord, etc have forgotten the scripts they must use.
    Please reply ASAP with instructions either through PM or on this thread.
    Thank you very much.
    -Ghostfrog
     
  2. MGMT

    MGMT

    Joined:
    May 18, 2014
    Posts:
    9
    @Dreeka I am using Unity 4.50f6
     
  3. Muralidaran

    Muralidaran

    Joined:
    May 2, 2014
    Posts:
    93
    Hi Dreeka,
    Thanks for the reply. I got most of it worked out the only thing left is the PlayerManagerJS.updateSkin. In my game there are going to be 3 skins total, the one they start with, a Better sub, and the Best sub. I am no sure where to update the player manager script. Could you post an example of that script please along with any other changes I might need to make to the GUIManager to accommodate the 3 textures.

    Thanks again for all the help.
    Mura
     
  4. MGMT

    MGMT

    Joined:
    May 18, 2014
    Posts:
    9
    @Dreeka I just updated to the newest version of unity and same issue.
     
  5. freakprince

    freakprince

    Joined:
    Apr 25, 2012
    Posts:
    63
    Dreeka, i need to call the fadetoscreen overlay coroutine in a fixedupdate, and i do it by saying if(bool=true) docoroutine bool=false, its working but theres a jittering effect on the overlays alpha for a moment
     
  6. menevse

    menevse

    Joined:
    Jul 18, 2014
    Posts:
    2
    Hello Guys and @Dreeka

    When I try to use sonic blast power up it not always but rarely sticks to left side of the screen and doesnt move from there. I need to kill the app and start over the again to solve it. Does it ever happen to anyone before ? Is there a fix about it ?

    Thanks.
     
  7. Que

    Que

    Joined:
    Mar 14, 2014
    Posts:
    135
    Have you tried the latest release of Unity. It works for me, though no modification that's my next action.
     
  8. MGMT

    MGMT

    Joined:
    May 18, 2014
    Posts:
    9
    @Que, Just tried again but this time I reimported the package and now it works!
     
  9. Que

    Que

    Joined:
    Mar 14, 2014
    Posts:
    135
    Excellent, we share the same success of this kit.
     
  10. Dreeka

    Dreeka

    Joined:
    Jul 15, 2010
    Posts:
    507
    Ghostfrog:
    Open the project I sent you, then you can see where each script should go.

    Muralidaran:
    First, apply the skins to the subTextures field in the inspector, in the following order:
    Skin1Intact, Skin1Damaged, Skin2Intact, Skin2Damaged, Skin3Intact, Skin3Damaged.

    Then create a new int variable called skinID. Then the updateSkin method should look like this:
    Code (JavaScript):
    1. public function UpdateSkin(id : int)
    2. {
    3.      skinID = id - 1;
    4.      subRenderer.sprite = subTextures[id * 2];
    5. }
    You should also change every
    Code (CSharp):
    1. subRenderer.sprite = subTextures[1];
    to
    Code (JavaScript):
    1. subRenderer.sprite = subTextures[id * 2 + 1];
    And every
    Code (JavaScript):
    1. subRenderer.sprite = subTextures[0]
    to
    Code (JavaScript):
    1. subRenderer.sprite = subTextures[id * 2];
    freakprince:
    I have tried it inside the GUI Manager, and it works fine for me.
    Code (JavaScript):
    1. function FixedUpdate()
    2. {
    3.         if (DoStuff)
    4.          {
    5.             StartCoroutine(FunctionLibraryJS.FadeScreen(overlay, longTransitTime, 0.7f));
    6.                 DoStuff = false;
    7.         }
    8. }
    menevse:
    Never happend to me, and no one has reported a bug like this so far. Probably there is a bug in your modification.

    MGMT:
    Glad it works now! :)
     
  11. Muralidaran

    Muralidaran

    Joined:
    May 2, 2014
    Posts:
    93
    Hi Dreeka,

    So I did everything you said and it is still not working. I now get these errors:

    Assets/2DInfiniteRunnerToolkit/Scripts/JS/Managers/PlayerManagerJS.js(129,50): BCE0005: Unknown identifier: 'id'.
    Assets/2DInfiniteRunnerToolkit/Scripts/JS/Managers/PlayerManagerJS.js(159,42): BCE0005: Unknown identifier: 'id'.
    Assets/2DInfiniteRunnerToolkit/Scripts/JS/Managers/PlayerManagerJS.js(189,42): BCE0005: Unknown identifier: 'id'.
    Assets/2DInfiniteRunnerToolkit/Scripts/JS/Managers/PlayerManagerJS.js(423,42): BCE0005: Unknown identifier: 'id'.
    Assets/2DInfiniteRunnerToolkit/Scripts/JS/Managers/GUIManagerJS.js(417,25): BCE0020: An instance of type 'PlayerManagerJS' is required to access non static member 'UpdateSkin'.
    Assets/2DInfiniteRunnerToolkit/Scripts/JS/Managers/GUIManagerJS.js(429,29): BCE0020: An instance of type 'PlayerManagerJS' is required to access non static member 'UpdateSkin'.
    Assets/2DInfiniteRunnerToolkit/Scripts/JS/Managers/GUIManagerJS.js(438,25): BCE0020: An instance of type 'PlayerManagerJS' is required to access non static member 'UpdateSkin'.
    Assets/2DInfiniteRunnerToolkit/Scripts/JS/Managers/GUIManagerJS.js(450,29): BCE0020: An instance of type 'PlayerManagerJS' is required to access non static member 'UpdateSkin'.
     
  12. freakprince

    freakprince

    Joined:
    Apr 25, 2012
    Posts:
    63
    Dreeka: How can i remove your mission system? what scripts do i remove?
     
  13. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    780
    Cant help but notice that this new kit thats just been released seems to be VERY similar to yours...
    http://forum.unity3d.com/threads/2d-endless-runner-kit.257206/
    Im hoping they have not just re-skinned and re-wrote your system, everything thats described seems to be identical to what your system offers!

    Of course, I know people can make similar assets, with similar functionality, but this just seemed too similar to me...
     
  14. Acumen

    Acumen

    Joined:
    Nov 20, 2010
    Posts:
    1,041
    Hey, thanks for bringing it to our attention.
    It sure looks very similar in theme, feature-set and asset choices.
    We will investigate this within the next days. Obviously if this IS based on any of our code we will get in contact with Unity to work this out, since that would be quite dubious practise.
     
  15. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    780
    No worries. We have used this kit in a game before, and it was a superb platform for us to build upon, so I would hate to see someone ripping off your work directly!
     
  16. Plott

    Plott

    Joined:
    May 12, 2014
    Posts:
    94
    @Acumen @Dreeka

    Thanks for the toolkit, I'm trying to dissect certain things out of this to teach myself c#. Here is my question

    On InputManager.cs Where is says THIS


    Code (CSharp):
    1.     //Moves the selected button down
    2.     void ButtonPressed(Transform b)
    3.     {
    4.         if (b.tag != "Button")
    5.             return;
    6.  
    7.         //Save the button's reference
    8.         button = b.transform;
    9.  
    10.         //Move the button down by 0.05
    11.         tempPos = button.position;
    12.         tempPos.y -= 0.05f;
    13.         button.position = tempPos;
    14.     }
    15.     //Moves the button back to it's place, and execute it's event
    16.     void ButtonReleased()
    17.     {
    18.         //Move the button up by 0.05
    19.         tempPos = button.position;
    20.         tempPos.y += 0.05f;
    21.         button.position = tempPos;
    22.  
    23.         //Notify the GUI manager, and remove the reference to the button
    24.         guiManager.ButtonPressed(button.gameObject.name);
    25.         button = null;
    26.     }
    I dont want a button transition. So I tried just saying this. (added full code)

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class InputManager : MonoBehaviour
    5. {
    6.     public GUITexture guiPunch;
    7.     public GUIManager guiManager;               //A link to the GUI Manager
    8.     public PlayerManager playerManager;         //A link to the Player Manager
    9.  
    10.     public bool useTouch = false;                //Use touch based controls
    11.  
    12.     public LayerMask mask = 1;                    //Set input layer mask
    13.    
    14.     private RaycastHit2D hit;                   //The hit raycast
    15.     private Vector3 inputPos;                   //The position of the input
    16.     private Vector3 tempPos;                    //A temporary position for the buttons
    17.     private Transform button;
    18.  
    19.     //Called at every frame
    20.     void Update()
    21.     {
    22.         if (useTouch)
    23.             GetTouches();
    24.         else
    25.             GetClicks();
    26.     }
    27.  
    28.     //If playing with mouse
    29.     void GetClicks()
    30.     {
    31.         //Get the position of the input
    32.         inputPos = Camera.main.ScreenToWorldPoint(Input.mousePosition);
    33.         inputPos.z = 0;
    34.        
    35.         //Cast a ray
    36.         hit = Physics2D.Raycast(inputPos, new Vector2(0, 0), 0.1f, mask);
    37.  
    38.         //If we pressed the mouse
    39.         if (Input.GetMouseButtonDown(0))
    40.             if (hit.collider != null)
    41.         {
    42.             Button();
    43.         }
    44.         //If the ray did not hit an object
    45.         else
    46.         {
    47.             playerManager.UpdateInput(true);
    48.         }
    49.  
    50.     }
    51.  
    52.     //If playing with touch screen
    53.     void GetTouches()
    54.     {
    55.         //Loop through the touches
    56.         foreach (Touch touch in Input.touches)
    57.         {
    58.             inputPos = Camera.main.ScreenToWorldPoint(Input.touches[0].position);
    59.             inputPos.z = 0;
    60.  
    61.             //If a touch has happened
    62.             if (touch.phase == TouchPhase.Began && touch.phase != TouchPhase.Canceled)
    63.                 hit = Physics2D.Raycast(inputPos, new Vector2(0, 0), 0.1f, mask);
    64.            
    65.             //If the ray hit something in the set layer
    66.             if (hit.collider != null)
    67.             {
    68.                 Button();
    69.  
    70.             }
    71.             //If the ray did not hit an object
    72.             else
    73.             {  
    74.                  playerManager.UpdateInput(true);
    75.             }
    76.  
    77.  
    78.         }
    79.  
    80.     }
    81.  
    82.     void Button()
    83.     {
    84.  
    85.         guiManager.ButtonPressed(button.gameObject.name);
    86.         button = null;
    87.     }
    88.    
    89.    
    90. }

    Unfortunanly its not technicaly working. I get this error.


    NullReferenceException: Object reference not set to an instance of an object
    InputManager.Button () (at Assets/Scripts/InputManager.cs:85)
    InputManager.GetClicks () (at Assets/Scripts/InputManager.cs:42)
    InputManager.Update () (at Assets/Scripts/InputManager.cs:25)

    I'm building my GUIManager up, since I will only have a few buttons and I want to learn how this works.

    Here is my GUI Manager.

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class GUIManager : MonoBehaviour {
    5.    
    6.     public PlayerManager playerManager;
    7.     public InputManager inputManager;
    8.  
    9.     private bool inTransit;
    10.  
    11.     // Used for initialization
    12.     void Start()
    13.     {
    14.  
    15.     }
    16.  
    17. /*    public void ButtonPressed(bool inputActive)
    18.     {
    19.         if (true)
    20.         {
    21.             playerManager.Punch();
    22.     }
    23. */
    24.     public void ButtonPressed(string name)
    25.     {
    26.         if (inTransit)
    27.             return;
    28.        
    29.         switch (name)
    30.         {
    31.         case "PunchButton":
    32.             Debug.Log("PunchBTN!");
    33.             playerManager.Punch();
    34.             break;
    35.  
    36.            
    37.         }
    38.  
    39.     }
    40.  
    41. }
    Any idea what im doing wrong?? I got it to work with true and false statements like the Update Input part, but to add buttons, that would be a pain in the butt and not work correctly for me.

    Anything can help, thanks
     
  17. Dreeka

    Dreeka

    Joined:
    Jul 15, 2010
    Posts:
    507
    Muralidaran:
    Sorry, my bad, replace id to skinID in the changed lines. About the second set of errors, declare the following variable on the GUI Manager:
    Code (JavaScript):
    1. public var playerManager    : PlayerManagerJS;
    And in the BuySubmarineSkin functions, call the Player Manager's function the following way:
    Code (JavaScript):
    1. playerManager.UpdateSkin(1);
    freakprince:
    Which version do you use?

    Plott:
    Here is the working code:
    Code (CSharp):
    1. void GetClicks()
    2. {
    3.     //Get the position of the input
    4.     inputPos = Camera.main.ScreenToWorldPoint(Input.mousePosition);
    5.     inputPos.z = 0;
    6.      
    7.     //Cast a ray
    8.     hit = Physics2D.Raycast(inputPos, new Vector2(0, 0), 0.1f, mask);
    9.      
    10.     //If we pressed the mouse
    11.     if (Input.GetMouseButtonDown (0))
    12.     {
    13.         if (hit.collider != null)
    14.             guiManager.ButtonPressed(hit.transform.name);
    15.       else
    16.             playerManager.UpdateInput (true);
    17.     }
    18. }
    19.  
    20. void GetTouches()
    21. {
    22.     //Loop through the touches
    23.     foreach (Touch touch in Input.touches)
    24.     {
    25.         inputPos = Camera.main.ScreenToWorldPoint(Input.touches[0].position);
    26.         inputPos.z = 0;
    27.          
    28.         //If a touch has happened
    29.         if (touch.phase == TouchPhase.Began && touch.phase != TouchPhase.Canceled)
    30.             hit = Physics2D.Raycast(inputPos, new Vector2(0, 0), 0.1f, mask);
    31.          
    32.         //If the ray hit something in the set layer
    33.         if (hit.collider != null)
    34.             guiManager.ButtonPressed(hit.transform.name);
    35.         //If the ray did not hit an object
    36.         else
    37.             playerManager.UpdateInput(true);
    38.     }  
    39. }
     
  18. Plott

    Plott

    Joined:
    May 12, 2014
    Posts:
    94
    @Dreeka

    Thanks, I was actually gonna try that next.
     
  19. satanyu666

    satanyu666

    Joined:
    Aug 12, 2013
    Posts:
    5
    I wan't to replace the submarine with my own animated Character. I have covered the submarine with my own animation . I did that but then I can't add animation to its death . When the submarine crash , How can I change the animation to a crash animation?
     
  20. Muralidaran

    Muralidaran

    Joined:
    May 2, 2014
    Posts:
    93
    @Dreeka

    Hello again. So I did what you told me and I am now getting this error on the four lines where it is referenced.

    Assets/2DInfiniteRunnerToolkit/Scripts/JS/Managers/GUIManagerJS.js(413,25): BCE0020: An instance of type 'PlayerManagerJS' is required to access non static member 'UpdateSkin'.

    I know your busy with school but seriously, could you put up a complete step by step on how to add new skins. From the beginning. Please. My game should have been done weeks ago but we have been going back and forth on this one point and I still don't feel like I am any closer to having it done.
     
  21. Dreeka

    Dreeka

    Joined:
    Jul 15, 2010
    Posts:
    507
  22. Muralidaran

    Muralidaran

    Joined:
    May 2, 2014
    Posts:
    93
    Awesome. That would be great. Thanks
     
  23. BenM

    BenM

    Joined:
    Jul 22, 2014
    Posts:
    17
    Hi..

    Just bought this kit.. Looks like a good start, but I have an initial oddity.
    If I build for an Android device, I get blue bars down the left and right of the screen.. Tried 2 devices.
    It looks fine when played in the editor.

    BTW.. New to unity, so just tell me I am being an idiot if that is the case.

    Update:
    What I am really seeing is the game content (objects etc) are only being populated into the mid section of the screen. Sort of like it was only catering for an ipad 4:3 rather Android 16:10, which means that the right and left of the screen really have no game content and are only showing the background colour (blue)

    Here is a link to a screenshot.
    https://drive.google.com/file/d/0Bwtu2iJ42Dr2dGNfSXN6ZUUzZzI2SzVWcmo5QUFPWHpqUGNv/edit?usp=sharing

    Update again:
    I should mention that I do change the aspect ratio but this seems not to solve the problem seen.
     
    Last edited: Jul 31, 2014
  24. satanyu666

    satanyu666

    Joined:
    Aug 12, 2013
    Posts:
    5
  25. freakprince

    freakprince

    Joined:
    Apr 25, 2012
    Posts:
    63
    in my verson of the kit there is nothing on the 116line of torpedo layer script
     
  26. Dreeka

    Dreeka

    Joined:
    Jul 15, 2010
    Posts:
    507
    BenM:
    Can you tell me what device do you tested on?

    freakprince:
    It should be near line 116, or a few lines above/below, inside the SpawnTorpedo function. Look a for a line like this:
    Code (CSharp):
    1. torpedo.position = something....
    Replace this line with the modified one.

    The next update is going well, here is a little sneak peak of the next submarine skin:
     

    Attached Files:

  27. freakprince

    freakprince

    Joined:
    Apr 25, 2012
    Posts:
    63
    torpedo.position = Vector3(startAt, yPos, 0); ok i put this line and the spawning becomes buggy, the torpedo spawns halfway in the screen
     
  28. paliopolis

    paliopolis

    Joined:
    Aug 1, 2014
    Posts:
    5
    Hello Dreeka,

    I have a questions, say if I buy the toolkit now and you release the updates, will I get the update for free or will I have to pay for it?
    Or should I just wait for some time before I buy it? What is the tentative timeline?
     
  29. Dreeka

    Dreeka

    Joined:
    Jul 15, 2010
    Posts:
    507
    freakprince:
    In the torpedo layer's inspector, change the Start At value from -7.5 to 7.5.

    paliopolis:
    You can buy it any time you wish, the updates are free.
     
  30. freakprince

    freakprince

    Joined:
    Apr 25, 2012
    Posts:
    63
    yea dreek thanks this fixed my problem, BTW i still have a problem with the pause menu(if i change the sprites from your menu even with the same names it bugs out and every time i press pause the menus position moves a bit further on the right )
     
  31. freakprince

    freakprince

    Joined:
    Apr 25, 2012
    Posts:
    63
    Also dreeka can i have a SPRITE be scrolling layer? or does it have to be mesh-plane? BTW i want to remove the shop and mission manager i have v2.0 version (please help me)
     
  32. freakprince

    freakprince

    Joined:
    Apr 25, 2012
    Posts:
    63
    Final question: How does the particle layer work exactly? im hitting enemies tagged "Obstacle" and theres no smoke particle playing
     
  33. BenM

    BenM

    Joined:
    Jul 22, 2014
    Posts:
    17
    Devices tested were:
    Galaxy tab 10.1
    Nexus 4
    HTC evo4g (old device, but good for a test still)

    I should point out that whatever the issue is, user error or something else, it is obvious I am not alone, but most just seem to ignore the problem. EG. I have now seen a number of builds of this sub game on the play store and they all had the blue bars (incorrect asset x sizing). I guess it did not bother them.

    I have also manually fixed the issue by manually :
    Setting the Background Scale X to 1.5
    Setting the Sand Scale X to 1.5
    Moved the Hanger position X to 8

    Am I supposed to have to do this or is the code supposed to do it for me. If so, am I build the apk wrong somehow?
     
    Last edited: Aug 4, 2014
  34. Dreeka

    Dreeka

    Joined:
    Jul 15, 2010
    Posts:
    507
    freakprince:
    Can you send me your build? I don't know what is wrong with your pause menu without seeing it. You can't create a scrolling layer from a sprite.

    The easiest way to remove the shop and mission, is to disable the shop and mission buttons. That way, the user can't use them. You can completely remove them as well, but it is a lot longer.

    The explosion particles are created, when the player collides with a named obstacle. So the tag has to be an obstacle, but the name matters as well. If you want to add an explosion particle to a new obstacle type with a new name, you have to extend the Player Manager's OnTriggerEnter2D function as well.

    BenM:
    It looks like your devices use unsupported aspect ratios. But don't worry, I will add support for them in the next update (which can be excepted in 2 days). :) Also, the sub games you mentioned are created with the old resolution manager.
     
  35. adamvisionstudios

    adamvisionstudios

    Joined:
    Apr 24, 2014
    Posts:
    44
    I have PM'ed you a question Dreeka, it is in regards to resolutions. Thanks for your time :)
     
  36. freakprince

    freakprince

    Joined:
    Apr 25, 2012
    Posts:
    63
    can we talk via skype or anything like that?
     
  37. freakprince

    freakprince

    Joined:
    Apr 25, 2012
    Posts:
    63
    By the way, Can i use the resolution manager of a newer version of the kit in my project which uses the 2.0 version?
     
  38. Dreeka

    Dreeka

    Joined:
    Jul 15, 2010
    Posts:
    507
    Update 2.2 has been submitted to the Asset Store! It should be available soon.
    You can try the webplayer here.

    BenM:
    Which version do you use? I have tested the kit on the aspect ratios used by the devices you mentioned, and the resolution manager from 2.0 works well on them.

    freakprice:
    Sure. Did you added me to skype yesterday?
    If you use version 2.0, then you have the latest resolution manager.
     
  39. adamvisionstudios

    adamvisionstudios

    Joined:
    Apr 24, 2014
    Posts:
    44
    @Dreeka
    Thanks :) Definitely anticipating the 2.2 release. Do you have a changelog you can share?

    I am using this template as a learning tool for various things about Unity/Android development and it's been super handy in so many ways. Especially when working with google play services and learning about leader board and achievement integration. Whether I ever end up releasing a game with it has yet to be seen haha. Though I do have a question for you or anyone else in the community here;

    I am having a couple weird issues with resolutions. It seems both the Nexus 7 and Nexus 4 don't correctly adjust their screen spaces. Am I not correct in assuming that the following lines already in the code;

    Code (CSharp):
    1. //Aspect Ratio: 16:10
    2.         else if (Mathf.Abs(Camera.main.aspect - 1.6f) < 0.01f)
    3.         {
    4.             //print("16:10");
    5.             scaleFactor = scale16x10;
    6.         }
    should cover the resolution/aspect ratio of the Nexus 7 (resolution 1920*1200 / aspect ratio 8:5) ?
    I am not sure what I am doing wrong here, but would love to support the Nexus 7/4. I have successfully got the title working on a Galaxy S3, S4, Nexus 5, and Note 3.

    Any help would be greatly appreciated. Thanks a bundle.
     
    Last edited: Aug 12, 2014
  40. freakprince

    freakprince

    Joined:
    Apr 25, 2012
    Posts:
    63
    no i didn't add you yet where is your skype i dont see it in the documentantion
     
  41. BenM

    BenM

    Joined:
    Jul 22, 2014
    Posts:
    17
    I am using version 2.1.1 as I only bought it on 30-July. I am using 4.5.2f1 Unity.

    It seems @nickervision is mentioning the same issue on Nexus 4.
     
  42. paliopolis

    paliopolis

    Joined:
    Aug 1, 2014
    Posts:
    5
    Hi Dreeka,
    Thanks for the reply, I am *this* close to buying it, just have one more question for you !

    Can the missions and coins be disabled? What if I want to do is reskin it and the goal will be to just avoid the obstacles and the moving objects ! how easy or difficult it is to disable certain functionality (like the store etc.)? And then maybe enable it in a future update?
     
  43. adamvisionstudios

    adamvisionstudios

    Joined:
    Apr 24, 2014
    Posts:
    44
    @paliopolis
    If you are reasonably familiar with Unity, it is quite easy to tailor this Asset pack to your liking. You can very simply disable and remove bits and pieces with little to no code changes as well.
     
  44. adamvisionstudios

    adamvisionstudios

    Joined:
    Apr 24, 2014
    Posts:
    44
    Does anyone have any problems using ART runtime with this plugin?
     
  45. paliopolis

    paliopolis

    Joined:
    Aug 1, 2014
    Posts:
    5
    @nickervision Thanks ! I am just beginning with Unity so still learning and going through the tutorials :)
     
  46. BenM

    BenM

    Joined:
    Jul 22, 2014
    Posts:
    17
    @nickervision I have been testing and running my build on a Nexus 4 using the ART runtime with no issues.
     
  47. adamvisionstudios

    adamvisionstudios

    Joined:
    Apr 24, 2014
    Posts:
    44
    Hmmm, I wonder what I am doing wrong then. I seem to be running into problems with it running on ART. The only other unity plugins I am using are the Google Play Services and Google Ads. Anyone have any suggestion as to how to diagnose the problem?
     
  48. BenM

    BenM

    Joined:
    Jul 22, 2014
    Posts:
    17
    What kind of problems are you having. I am currently tearing hair out trying to get an admob plugin to actually show ads. I can see test ads, but no live ones.. Weird because a different plugin I am using to do the same thing is already live and showing ads happily.
     
  49. adamvisionstudios

    adamvisionstudios

    Joined:
    Apr 24, 2014
    Posts:
    44
    Hi @BenM

    I'm no expert so as far as I can tell you is that I used the official Google Mobile Ads for Unity Plugin and after a ton of tinkering with the code they provide in their readme, I got the ads functioning smoothly.

    The only problems I seem to be encountering is when trying to open the app I am making on a Nexus 7 or 5 with ART enabled instead of Dalvik, it crashes the moment it hits the menu and will not start no matter what. I am currently investigating if this has something to do with the Google Play Services auto logging in when the app starts. I am not certain yet though.

    The other problem is with resolution issues. The resolution manager doesn't seem to set resolutions correctly on Nexus 4 and Nexus 7. It just defaults to the scalefactor that is set for default when one is not found.

    It could have something to do with the odd resolutions / aspects.

    Nexus 4 (768 x 1280) 15:9 aspect
    Nexus 7 (1920 x 1200) 16:10 aspect

    I have set the default as 1.35f:
    Code (CSharp):
    1. else
    2.         {
    3.             print("Aspect Ratio not found");
    4.             scaleFactor = 1.35f;
    5.         }
    This fixes any problems on the Nexus 7 as the 1.35 is 16:10, but now the Nexus 4 cuts the sides off on the screens slightly since its supposed to be 16:9.

    I am not really sure why the Nexus 4 or 7 don't get detected in the resolution manager. Does anyone have any clues or know how to modify/add code that will fix this issue?
     
    Last edited: Aug 12, 2014
  50. BenM

    BenM

    Joined:
    Jul 22, 2014
    Posts:
    17
    Hi @nickervision ,

    Tried the official admob plugin but could not get it working. In hindsight I may have had other problems with my machine setup. Anyway, bought another plugin in the meantime to try and solve the issue, so thought I had better use it, given I just bought it. Finally got it working. Arrg.

    Google Play services would be included as part of the admob inclusion here, but not seen any real issue when running on Nexus 4 or Nexus 5 using ART (5 using Android L preview)

    Can't really say why the resolution issue is happening, but I just solved it with a few setting adjustments as mentioned in my previous post, rather than trying to fix the code. This, while a little inelegant, did give an acceptable result on the devices I checked it on.