Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug Control Children property of ControlPlayableAsset does not apply to ITimeControl

Discussion in 'Timeline' started by jhelbig, Apr 8, 2022.

  1. jhelbig

    jhelbig

    Joined:
    Jul 25, 2019
    Posts:
    6
    Hi,

    the current documentation for the 'Control Children' property in the 'Control Track' settings reads as follows:

    "Enable this property if the Source Game Object has a child GameObject with either a Playable Director, Particle System, or ITimeControl Script, and you want the Control clip to control this child component."

    According to the documentation, children of the Source Game Object with ITimeControl scripts should not be controlled by the track as long as this property is disabled.

    This does not seem to be the case and the source code appears to completely ignore this property in regards to ITimeControl scripts.

    The 'searchHierarchy' flag is checked when collecting particle systems:
    Code (CSharp):
    1.  
    2. IList<ParticleSystem> GetControllableParticleSystems(GameObject go)
    3. {
    4.     var roots = new List<ParticleSystem>();
    5.  
    6.     if (searchHierarchy || go.GetComponent<ParticleSystem>() != null)
    7.     {
    8.         GetControllableParticleSystems(go.transform, roots, s_SubEmitterCollector);
    9.         s_SubEmitterCollector.Clear();
    10.     }
    11.  
    12.     return roots;
    13. }
    The code for ITimeControl scripts never checks this property:
    Code (CSharp):
    1. internal static IEnumerable<MonoBehaviour> GetControlableScripts(GameObject root)
    2. {
    3.     if (root == null)
    4.         yield break;
    5.  
    6.     foreach (var script in root.GetComponentsInChildren<MonoBehaviour>())
    7.     {
    8.         if (script is ITimeControl)
    9.             yield return script;
    10.     }
    11. }
     
  2. rlevreault

    rlevreault

    Unity Technologies

    Joined:
    Apr 12, 2017
    Posts:
    4
    Thanks for putting the work in to discover this issue. I'll ask one of the Timeline devs about this. I might have misunderstood something when I wrote this paragraph.

    I'm currently working on a new version of the Timeline documentation. I will make sure this is corrected in the new documentation. Thanks again for finding this.
     
  3. rlevreault

    rlevreault

    Unity Technologies

    Joined:
    Apr 12, 2017
    Posts:
    4
    It turns out that the documentation is correct and this is actually a Timeline bug. An internal ticket has been created and sent to our Timeline devs.
     
  4. jhelbig

    jhelbig

    Joined:
    Jul 25, 2019
    Posts:
    6
    Thank you, that's nice to hear. I suppose I need to implement a workaround for the time being.