Search Unity

Scriptable Object not working in some devices.

Discussion in 'Scripting' started by danidiazr, Oct 30, 2020.

  1. danidiazr

    danidiazr

    Joined:
    Dec 27, 2016
    Posts:
    24
    Hi everybody,

    I've been searching a lot about this issue. I have two scripts LevelContent.cs (Scriptable object) and Manager.cs.

    LevelContent.cs
    Code (CSharp):
    1. public class LevelContent: ScriptableObject
    2. {
    3.     [HideInInspector]
    4.     [SerializeField]
    5.     public GameObject general_background;
    6.     }
    7. }
    8.  
    Manager.cs
    Code (CSharp):
    1. public class LevelContent: ScriptableObject
    2. {
    3.     public LevelContent content;
    4. }
    (Code for reference)

    I have a manager in my scene and one scriptable object asset, and that asset is attached to the Manager's public variable "content".

    In editor it does works awesome, building for iOS & Android it goes well too.

    My issue is that attachement crashes in some devices (I've tested it on Android 5.5 and crashes). There's no log, no errors, no messages, anything... the app just close as if I pressed home button.

    I know that the issue is specifically the attachement (reference) because when I deattach the "content" asset (leave the LevelContent content empty or null), the app goes awesome.

    I might not say that the issue is in older devices because in my published app I got reviews from Android 7 or 9 having the same problem that the app just close.

    I tried to load the scriptable object from Resources folder trying to find if the attachement is the problem, no matter where or how do I load the reference, I have the problem. Just by having the reference, the app crashes.

    I can say that I see this issue in 10% of the whole users.

    I tested in some devices: Note 8, S8, A8, iPhone 6 & XR, and some Huawei devices with no problem.

    I'm using Unity 2019.4.4f LTS and I just upgraded it to 2019.4.13f LTS.

    Any ideas?
     
  2. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    7,188
    So logcat doesn't display any error? Currently, I'm not leaning towards the scriptable object as the issue. Not saying it isn't, just saying when debugging issues, I try to keep a more open approach. The only other option I can think of is if the device ran out of memory or something. The specs on the phones could be a factor.