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 have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

I need help toggeling camera image effect script on/off!

Discussion in 'Scripting' started by the_invizible_dood, Mar 17, 2020.

  1. the_invizible_dood

    the_invizible_dood

    Joined:
    Jan 9, 2017
    Posts:
    5
    hi guys

    this is my first post here and i realy need some help
    i think my problem is simple enough but for some reason i can't get it to work
    i downloaded this glitch script : https://github.com/keijiro/KinoGlitch
    i applied it to the main camera it works flawlessly
    now i want the script to start when i enter a trigger simple.
    the problem is i'm trying to make a script that can access main.camera's script "AnalogGlitch"
    for some reason ( GetComponent<AnalogGlitch>().enabled = false ) deos not work and i get error
    this error

    The type or namespace name `AnalogGlitch' could not be found. Are you missing `Kino' using directive?

    i'm sure this is the name of the script and the class so i'm realy confused
    pls i need help if anyone can propose a simple script or where i'm i getting it wrong

    and i think the main thing here is how to get script component from the camera?

    ps: sorry if i'm not clear enough english is not my first language thanks in advance
     
  2. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,199
    The error message is telling you that you're missing 'Kino' using directive. That's exactly what's missing! Put it on the top of your script with the other using directives:

    Code (csharp):
    1. using Kino;
    The script author was nice and stuffed their code into a namespace so the name wouldn't conflict with anything.
     
    the_invizible_dood likes this.
  3. the_invizible_dood

    the_invizible_dood

    Joined:
    Jan 9, 2017
    Posts:
    5
    thank you so much @Baste
    this solve my problem
    also
    I tried putting <Kino.AnalogGlitch> and this one also worked