Forum rules - please read before posting.

RememberLight.cs not working

Hi there,

I've tried to follow this tutorial
https://www.adventurecreator.org/tutorials/saving-custom-scene-data
to save the turn on/off state of light. I copied the whole script, saved it as RememberLight.cs and attached it to the light. After that, when trying to run the game, I get this error message:
CS0118: "UnityEngine.Component.light" is a "property" but "type" was expected

Any idea of why is this happening?


Comments

  • It sounds like there may be a mismatch in your copying of the script over.  Could you share your exact script in e.g. http://pasteall.org/?
  • Nevermind, I found the typo. Thanks.
  • Sorry to bother again Chris. Could you tell me how to make a light to be intermitent? I've been searching around and found no info at all.
  • In what way, exactly?  You can always just animate it's values and control it in AC with an Object: Animate Action.
  • edited September 2017
    What I want to do is to change the intensity values of a light every given time (0.3 seconds), but I'm confused about how to do it.
    If I create an "obect: animate action" it will ask for a clip, but I can't create a clip with an object with the light component attached, right?
    Excuse my english, I hope that was understandable.
  • Any public Inspector field can be animated, and that's not an AC feature - that's Unity.

    Never mind having AC control the animation for now - first work on creating the actual animation itself.  If the animation will always play, there may not even be a need for AC to control it.  See Unity's documentation on Animators and Animations for more on how to keyframe Inspector fields in animation clips.
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.