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

works fine in mono build and editor
this happens on NX and windows
tested with other events, they all fire up

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


6747067--777853--upload_2021-1-20_17-25-2.png

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.

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

it is overstripping!
if you add this script inside the FSM folder then it works fine.

using FSM.FSM_Core;
using UnityEngine;
using UnityEngine.Playables;

namespace FSM
{
    public class FSMActionPlayable : FSMAction
    {
        public PlayableDirector timeline;
        public PlayableAsset playable;
        public override void Act()
        {
            timeline.Play(playable);
        }
    }
}

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

1 Like

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?

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

Totally and the doc is not too clear how smart the Il2cpp linker is with regard to Unity Events which use refelction.
However :
6753649--779095--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

This is a regression that was reported about a month ago. If you use 2020.1.15f1 or below, you should not have the issue.