onEnter() just call once when play again and startTime = 0?

Forums 💬 Slate Sequencer ⚙️ Support onEnter() just call once when play again and startTime = 0?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #21232
    jakin
    Participant

      In Play Mode, onEnter() always do when every time click Play button(not click Stop button) and startTime > 0
      But, onEnter() just do once when startTime = 0..Is it correct ??

      The problem may cause my custom clip not do init in onEnter()…Orz

      #21236
      Gavalakis
      Keymaster

        Hello,

        OnEnter is called every time the cutscene time enters (or exceeds) the clip’s start time (and before Update), not just once.
        This is true for both editor and playmode.

        There could be something else going on here. Can you share your custom clip?
        Thanks.

        #21235
        jakin
        Participant

          Not just my custom clip, you can try this..
          1,write Debug.Log in TranslateBy, RotateTo onEnter<Drag clip to IN = 0> and ActorActionTrack, ActorGroup IDirectable.Enter
          2,Click play button first<do not click stop button when play end>, It output log correctly
          3,Click play button again<do not click stop button>, log not output…..
          4,Drage TranslateBy, RotateTo clip to IN != 0, play again, it will output log, but track and group still not output log

          #21234
          jakin
          Participant

            I try to modify here..seems ok for me

            1, In Cutscene, this is for play again not call onEnter when startTime = 0

            Before:
            //update time
            currentTime += playingDirection == PlayingDirection.Forwards? delta : -delta;

            After:
            if (playingDirection == PlayingDirection.Forwards)
            {
            if (currentTime >= previousTime) currentTime += delta;
            }
            else
            {
            if (currentTime <= previousTime) currentTime -= delta;
            }

            2, TriggerBackward In TimeInPointer, this is for click on timeline not call onEnter when clip startTime = 0
            Before:
            if (currentTime < target.startTime || currentTime <= 0)

            After:
            if (currentTime < target.startTime || currentTime <= 0 || (currentTime == float.Epsilon))

            #21233
            Gavalakis
            Keymaster

              Oh.. Now I see what you mean. I will fix this in the next update
              Thanks for the bug find!

            Viewing 5 posts - 1 through 5 (of 5 total)
            • You must be logged in to reply to this topic.