Problem with functions/methods

Hi, a few days ago I ran into a problem where every time I call the play() function in checkTriggerAction() (PlayableDirector) or playbackTrigger()(VideoPlayer), I get the error is not a function/ is not a function. I’ve tried to disable the playable director, turn on PlayOnAwake, and enable the component from the script. But without succes.
Also, I’ve got some errors (999+) when playing the scene from animations, and that wasn’t the case in an older version of needle exporter. I can’t reproduce now the errors, but anyway, the PlayableDirector isn’t running anymore on the site.

Original Post on Discord

by user 328144332622266369

Hi, are you on the latest version? There was an issue with Timeline playback but it should be fixed already

Hi, can you also share some of the browser errors with us (please open the dev console. refresh the website, wait for the errors to show and then unfold one of them to show the stacktrace)

by user 328144332622266369

Is one of the array elements perhaps unassigned? Or what is the type of waypoint.videoPlayer? When you log the array in the start method do you see a list of VideoPlayer components (assuming that’s what is assigned)

About the timeline: can you check if there are any empty AnimatorControllers assigned (an animator controller without any states)? There was an issue in the latest version that caused timeline animations to not play anymore in that case (should be fixed in the version that was just released)

Timeline works now. Thanks a lot ! About the waypoint.videoPlayer, I didn’t declared properly. This is how should be declared as a Serializable.

by user 328144332622266369

ah great yep. Btw you dont have to write = new VideoPlayer etc you can either write videoPlayer?:VideoPlayer; (make it possibly undefined) or also videoPlayer!:VideoPlayer (use ! to tell typescript you KNOW it won’t be null or undefined)

Depending on how many Waypoints you have that might save you a bunch of class instances being created for nothing (since de-serialization will override them)

Out of curiousity: how did you do it before?

@serializable() timeline: PlayableDirector = new PlayableDirector(); . Same goes for the videoPlayer. :sweat_smile:

by user 328144332622266369

Ah ok :slightly_smiling_face: