Search Unity

Can't make streaming image sequence to update when manually changing current frame/time

Discussion in 'Scripting' started by dennik, Mar 3, 2021.

  1. dennik

    dennik

    Joined:
    Nov 23, 2011
    Posts:
    101
    I made a script that changes the current time on a streaming image sequence I set up with a few photos.
    The script scrubs back and forth the current time in the track, however the game view does not update to show the frame at the current time location. Not sure why.
    Any clues?
     
  2. dennik

    dennik

    Joined:
    Nov 23, 2011
    Posts:
    101
    To be exact, I followed this tutorial to set it up https://docs.unity3d.com/Packages/c...l/en/StreamingImageSequencePlayableAsset.html
    However the scripts are adamant about just playing it straight through but if you attempt to change the time manually using lets say: playabledirector.time = 0.1 etc the texture won't update with the image at that spot.
    The image only updates if you scrub on the timeline window, but it won't if you change the time value in the playable director script through the editor window.
     
  3. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,692
    Your success is probably dependent on understanding if this package can do what you intend.

    Assuming it can, then your problem becomes making sure your user inputs are actually causing the right inputs to this package to cause what you want, as per what the docs say.

    To help gain more insight into your problem, I recommend liberally sprinkling Debug.Log() statements through your code to display information in realtime.

    Doing this should help you answer these types of questions:

    - is this code even running? which parts are running? how often does it run?
    - what are the values of the variables involved? Are they initialized?

    Knowing this information will help you reason about the behavior you are seeing.
     
  4. dennik

    dennik

    Joined:
    Nov 23, 2011
    Posts:
    101
    Thanks for the suggestions. For now I decided to just convert the sequence to sprites and load them on a sprite renderer through a script. I don't know if it's the most efficient way, but at least it's my code and I understand what it's doing!
     
    anycolourulike and Kurt-Dekker like this.