Skip to main content
1 of 3
LifGwaethrakindo
  • 1.4k
  • 2
  • 15
  • 27

FirstPersonCharacter itself does not have Blur component, but the GameObject attached to it does:

[SerializeField] FirstPersonController FPC; /// <summary>Your First Person Controller.</summary>
/// Option 1.
private Blur blur; /// <summary>Blur's Script.</summary>
/// Option 2.
[Serializefield] GameObject objWithPFCAndBlur; /// <summary>So you could get both components from this GameObject.</summary>

void Awake()
{
    blur = FPC.gameObject.GetComponent<Blur>();
    if(blur != null)
    { /// As a good practice, you should do null checkings, on cases like this.
         Debug.LogError("There was no Blur attached to GameObject");
    }
}
LifGwaethrakindo
  • 1.4k
  • 2
  • 15
  • 27