Search Unity

IL2CPP stop instantiate

Discussion in 'Editor & General Support' started by ramthh, Dec 8, 2021.

  1. ramthh

    ramthh

    Joined:
    Oct 31, 2021
    Posts:
    3
    When I build the game with Mono in Project setting > Player > Android Configuration instantiate works fine.


    But I can't upload my game to google play store
    Untitled121212.png

    and when I build the game with IL2CPP 64bit instantiate stop working!!!
    What should I do?
    I am using Bolt.
    game working fine in editor and when build it for windows too.
    The only problem is IL2CPP, How can I build mono with 64bit?
    If there is no way to do that, then please help me fixing instantiate a clone of my gameobject.
     

    Attached Files:

  2. ramthh

    ramthh

    Joined:
    Oct 31, 2021
    Posts:
    3
    To be more clear I am trying to shoot Arrows but this only work when building game in Mono not IL2CPP.
     
  3. Adrian

    Adrian

    Joined:
    Apr 5, 2008
    Posts:
    1,066
    64bit Mono is not supported by Unity on Android.

    There can be slight difference in behavior between Mono and IL2CPP, which probably caused an issue in your code. There's really no other way than to debug your game on an Android device to figure out what is going wrong. It's likely not a setting but something you need to fix in your code.
     
  4. ramthh

    ramthh

    Joined:
    Oct 31, 2021
    Posts:
    3
    Thanks I used everything you shared to reach my problem,,,,

    I would like to share my results with everyone so people can fix this problem if they face it!
    after making a lot of investigation about the error I found it, it was very very tricky!

    - Mathf.Infinity is a constant (const)

    - It is equal to float.MaxValue (another constant)

    - Therefore it only emits IL for the constant value itself

    when building to IL2CPP this will ignore Mathf.Rad2Deg which make the value incomplete. ignoring the node!!!

    I fix it by writing down the equation myself "360 / (PI * 2)"

    Problem solved

    Wish this save time on others

    Red2Deg.png