Forum rules - please read before posting.

Camera ImageEffect

Image Effect)
">Hello, I wanted to ask if it was possible to manage different effects
in the room at different times in the same scene (Standard Asset->
Image Effect)
I admit they are not very good at programming, I have been found after
a "Camera Effect" where he addressed the problem, I tried in every way
but I could not make it work.
in the post "Camera Effect" Chris says:

That's
right - simple enough to do, you could even just have a script That has
functions to enable and disable the entire "effect" component.
In C, this would be something like:

void TurnOnEffect ()
{
  
().enabled = true;
">this.GetComponent <MyEffect> (). enabled = true;
}


void TurnOffEffect ()
{
  
().enabled = false;
">this.GetComponent <MyEffect> (). enabled = false;
}

Attach the script to your GameCamera, then use the Object: Action Send
message to send the custom messages "TurnOnEffect" and "TurnOffEffect"
as appropriate.

I tried as indicated but Unity me by several errors when creating the script.

My setup is:
Windows 7 professional
unity 5.2.1f1
AC 1.49a

As mentioned I tried to look for other posts, but in the end I did not understand if it is possible or not.

Thank you and hope not that you have not created a useless post.
hello Seto

Comments

  • I don't know when I wrote that, but when it comes to camera effects you'll generally want to have them on the MainCamera and change the values on them (or enable/disable them) as needed.

    What is it you're trying to do, exactly?  Tweak an effect from camera to camera, or have one only active when a particular camera is active?
  • do not get me wrong, I do not speak English very well.
    I am that I can not do it.

    I want to have a particular effect when a particular camera is active.
    And I can not turn on and off inside the MainCamera.
  • Sure.  Just understand that this is not a scripting forum.  I can help you so far as how to use AC's code base goes, but you'll have to look elsewhere for general programming help.

    You have to have a script that checks if the GameCamera in question is active.

    e.g:

    void Update ()
    {
      if (AC.KickStarter.mainCamera.attachedCamera == myCameraWithEffect)
      {
        // Turn on the effect
      }
      else
      {
        // Turn off the effect
      }
    }

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.