Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We are updating our Terms of Service for all Unity subscription plans, effective October 13, 2022, to create a more streamlined, user-friendly set of terms. Please review them here: unity.com/legal/terms-of-service.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice
  4. Join us on Thursday, September 29, for a day with Unity's SRP teams here on the forum or on Reddit, and discuss topics around URP, HDRP, and the Scriptable Render Pipeline in general.
    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:
    3
    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:
    3
    Thank you, that's nice to hear. I suppose I need to implement a workaround for the time being.
     
unityunity