Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

Bug PlayableDirector.Play(Playable) not working in IL2CPP when called from a unity event!

Discussion in 'Timeline' started by laurentlavigne, Jan 21, 2021.

  1. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,473
    works fine in mono build and editor
    this happens on NX and windows
    tested with other events, they all fire up

    upload_2021-1-20_17-20-10.png

    upload_2021-1-20_17-21-15.png
    upload_2021-1-20_17-25-2.png
     
  2. DavidGeoffroy

    DavidGeoffroy

    Unity Technologies

    Joined:
    Sep 9, 2014
    Posts:
    542
    Do you have any code at all that invokes the PlayableDirector?

    Looks like it's getting stripped.

    Because there's nothing specific about playable director and IL2CPP.
     
  3. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,473
    None, everything is called via unityevents as shown above.
    I have logged a bug with project and repro if you want to take a look.
    1307887
     
  4. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,473
    it is overstripping!
    if you add this script inside the FSM folder then it works fine.
    Code (CSharp):
    1. using FSM.FSM_Core;
    2. using UnityEngine;
    3. using UnityEngine.Playables;
    4.  
    5. namespace FSM
    6. {
    7.     public class FSMActionPlayable : FSMAction
    8.     {
    9.         public PlayableDirector timeline;
    10.         public PlayableAsset playable;
    11.         public override void Act()
    12.         {
    13.             timeline.Play(playable);
    14.         }
    15.     }
    16. }
     
  5. DavidGeoffroy

    DavidGeoffroy

    Unity Technologies

    Joined:
    Sep 9, 2014
    Posts:
    542
    That's what I thought. I had heard something similar before I think.

    I'll do a follow-up on your bug, but stripping and Unity Events are a bit out of my expertise. There's a decent chance that there's already a bug in someone else's backlog about this.

    But each time someone files a bug report about an existing bug, the priority increases, so it's not wasted effort
     
    Last edited: Jan 22, 2021
    laurentlavigne likes this.
  6. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,473
    Alright thanks David.
    I'll have to move on to other things so maybe I'll encounter this overstripping again. Do you happen to remember which other parts of unity get that?
     
  7. DavidGeoffroy

    DavidGeoffroy

    Unity Technologies

    Joined:
    Sep 9, 2014
    Posts:
    542
    Not quite sure, as I don't fully understand the mechanics.
    My guess is that it can apply to any API endpoint unless we specifically mark it as required.

    And marking it as required is a double edged sword because it increases everyone's build size
     
  8. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,473
    Totally and the doc is not too clear how smart the Il2cpp linker is with regard to Unity Events which use refelction.
    However :
    upload_2021-1-22_9-7-27.png
    PlayableDirector is in the scene so Playable API should not be stripped. I didn't test but my guess is the linking profile for Playables includes the PlayableDirector but not the API to access is (how? mystery), which is a mistake so I logged it as bug #1308498
     
  9. DavidGeoffroy

    DavidGeoffroy

    Unity Technologies

    Joined:
    Sep 9, 2014
    Posts:
    542