0
Under review

Change Intensity Multiplier via Action

Cr4shBarcode 2 weeks ago in Game Creator updated 9 hours ago 2

I'm making a transition from day to night in my game. The Intensity Multiplier, located in the Lighting options, is integral to this.


By increasing it, I can make a scene look like daytime without the need to add a bunch of cumbersome lights. 


Decrease it and things become pitch dark, the only light coming from the ones I've baked into the scene.

If I can't alter the value via an action, I'll be forced to create an entirely separate scene, just so I can have a different Intensity Multiplier value for it.

Despite there being a couple YouTube tutorials that work with the Intensity Multiplier, I need to find a script that works with Game Creator.

Unity version:
Game Creator version:
Under review

You'll need to create a custom Action for this. Not sure if you're familiar with programming, but even if you're just the slightest, it should be fairly easy to do. You can follow the instructions set at https://docs.gamecreator.io/game-creator/systems/game-creator-api/custom-actions.

If you're not familiar with programming, someone from the Discord might be up to lend you a hand. If you have any questions on how to create the Action, feel free to continue below these lines.

This is as far as I got. I'm not sure what to do next. I just want an action that sets the value of the Intensity Multiplier.

namespace GameCreator.Core
{
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;

[AddComponentMenu("")]
public class IntensityMultiplier : IAction
{
public int LightingValue = 0;
public static float ambientIntensity;


public override bool InstantExecute(GameObject target, IAction[] actions, int index)
{
Debug.Log(this.example);
return true;
}

#if UNITY_EDITOR
public static new string NAME = "Custom/IntensityMultiplier";
private const string NODE_TITLE = "Change the value of Unity's Intensity Multiplier to brighten or darken the ambient lighting of a scene";
#endif
}
}