Search Issue Tracker
Signal emitters disregard the "Emit Once" field when they affect parent Timelines or are placed at end of Timelines
How to reproduce:
1. Open the attached project "case_1141766-SignalsNoRepeatIssue" and scene "SampleScene"
2. Select "ControlObject" to view its Timeline
3. Double click its control track to view the "RewindParent" child Timeline track
4. Enter Play Mode
5. Observe the Timeline's play head and the Game View
Expected result: the "RewindParent" Timeline emits the "repeat" signal thus rewinding the child cube's animation back a second only once
Actual result: the "RewindParent" Timeline emits the "repeat" signal indefinitely even though the signal emitter's "Emit Once" field is set
Reproducible with: 2019.1.0b9, 2019.2.0a10
Could not test with: 2019.1.a10 (repro project's timeline assets cannot be opened)
Note: in the Console Window notice that the "rewind" signal is also triggered on the "RewindSelf" object's Timeline but it does not perform the action of rewinding when it is placed at the very end of the Timeline. Also, notice that if the signal is moved to the middle (moving the signal moves it for both the "RewindParent" and "RewindSelf" as they use the same Timeline Prefab) of the Timeline the "RewindParent" GameObject's Timeline emits the "rewind" signal only once even though the "Emit Once" field is turned off
The Emit Once property works as expected: when a timeline begins playing, the Emit Once state is reset. Here's what's happening: 1) Playback on the parent and the child begins 2) Playback on the child hits the end of the timeline. At this point, two things happen (in this order): - Since the child timeline is finished, it is paused (OnBehaviourPause is called). - The "rewind" signal is sent, which sets the time on the parent 3) The parent continues playing from the time set by the "rewind" signal. The parent sees that its child timeline is paused and changes its state to Playing. Since there is a change in the play state of the child timeline, the Emit Once state is reset, and the signal is emitted indefinitely. There are two ways to avoid this: a) Move the signals to the parent timeline. The parent timeline will not change its playstate and thus the Emit Once state will not be reset. b) Move the last signal a couple of frames before the end of the child timeline or add a couple of frames to the child timeline's duration. If the signal is sent before the child timeline ends, the Emit once state will not be reset.
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- [Tile Map] Default cursor doesn't change to resize cursor on hovering over Default brush section in Tile Palette window
- After light bake, when light is switched from Baked to Realtime - it does not emit any light
- Multi-material list ordering does not respect DCC material ordering
- Timeline Track Clip locks to the Timeline cursor's position when moving it in the Timeline Asset
- [Particles] Infinite lifetime + prewarm causes errors