Search Unity

Question Can't access bool from VcamExtraState

Discussion in 'Cinemachine' started by Kurteth, Sep 2, 2020.

  1. Kurteth

    Kurteth

    Joined:
    Aug 7, 2018
    Posts:
    15
    First: I don't have much experience with C# and I am learning as I go. So, forgive me if this is completely obvious and I just screwed up the syntax haha.

    As the title says, I am trying to access the bool from VCamExtraState. The bool is "targetObscured" and it is inherited to the class CinemachineCollider.

    Long story short, I am trying to write a very short script that checks when targetObscured is true, to run a method I have in a different script. But, because VcamExtraState is its own class, I am unable to access it.

    Is there a workaround, or am I missing something obvious?

    Thanks!
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    Just call
    collider.IsTargetObscured(vcam)
     
    Kurteth likes this.