Forum rules - please read before posting.

any way to change the color, intensity of a light using ActionList?

I have doors that are blocked and others that are useable each is distinguished with a proper color light. Right now I do it complicatedly by using two lights each with a different color. Is there a better way? If possible also the intensity value would be nice to have it in an action list.

SUre you can do it with scripting but that would defeat the purpose of AC

Comments

  • You can just animate the light's colour.  Attach an Animator component to the light, set up animations and Mecanim parameters that change the colour, then use Object: Animate Action to trigger it.

    Alternatively, a custom Action could do this - understand that it'd be impossible to have "official" Actions for each and every thing someone might need when building a game.  Something like changing a light's colour would be very specific to your game, but also very simple to implement in a custom Action.
  • Yes indeed I am doing it with a Custom Action so that I can change color, intensity and blinking. I am slow in scripting but I have managed 2 new ones for me and by now I would know how to do this one too.
  • So I made the script that turns on/off and changes colors of a point light and it works as a Custom  ActionList but I have not been able to make the blinking because I have to do it inside the script as a while(true) loop and it returns an error because the routine return a : return 0f but obviously I can never return if it's in a while loop.

    can you help me find a way to do a simple flicker light ON/OFF function that I could insert in my Custom script  that would work within AC

  • The return value is the time (in seconds) that will elapse before the Action is re-run.  If it's zero, the Action is never run again.  If you send a positive value, you AC will also need the Action's "isRunning" boolean to be set to False before the Action ceases to run.  If you want to re-run the Action a very brief time after, return the value "defaultPauseTime".  This is explained an demonstrated in the ActionTemplate.cs file.

    You can see a practical example of this in ActionTransform.cs, where the Action is continually re-run while linkedProp's isMoving variable is set to True.
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.