Search Unity

Request: CinemachineTargetGroup.Clear()

Discussion in 'Cinemachine' started by FuriousEX, May 25, 2020.

  1. FuriousEX

    FuriousEX

    Joined:
    Mar 13, 2014
    Posts:
    51
    I've run into this a few times now - could you guys add a simple clear method to CinemachineTargetGroup?

    Tracking the lifecycle of members seems unnecessarily cumbersome.

    Thanks!
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,719
    You can use
    TargetGroup.RemoveMember()
    to remove a specific member, or
    targetGroup.m_Targets = new CinemachineTargetGroup.Target[]
    to clear the whole thing in one shot.
     
    gaborkb likes this.
  3. FuriousEX

    FuriousEX

    Joined:
    Mar 13, 2014
    Posts:
    51
    Thanks for the tip!