Skip to content

LSequence: Appending to Sequence apparently modifies the value? #226

@bajtix

Description

@bajtix

I was trying to create an LSequence with CanvasGroup alphas for a game. The following code, however, seems to cause all of the items to be visible at once for a single frame. This happens only sometimes and I was unable to isolate the issue, but it seems to happen only when adding motions to sequences in loops.

var lSequence = LSequence.Create();
lSequence.AppendInterval(m_defaultInterval);
lSequence.Append(LMotion.Create(1f, 0f, m_fadeDuration).BindToAlpha(m_groups[0]));

foreach (var w in m_groups.Skip(1)) {
    lSequence.Append(LMotion.Create(0f, 1f, m_fadeDuration).BindToAlpha(w));
    lSequence.AppendInterval(m_defaultInterval);
    lSequence.Append(LMotion.Create(1f, 0f, m_fadeDuration).BindToAlpha(w));
}
lSequence.Append(LMotion.Create(0f, 1f, m_fadeDuration).BindToAlpha(m_groups[0]));
lSequence.Run();

I was unable to capture this using screen recording software (it does not happen when recording for some reason), so here is a video of the issue I captured on my phone.

bug.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions