How to change the intensity of a light

I just want to change the intensity of a light.

The script is already in the light object, but I can’t turn it up or down to save my life, and wherever I look, no one has the answer.

using System.Collections; using System.Collections.Generic; using UnityEngine;  public class Flashlight : MonoBehaviour {      public bool flashOn;       void Update()     {         if (flashOn)         {             light.intensity = 0;               if (Input.GetKey("q"))             {                 flashOn = false;             }         }         else         {             light.intensity = 1;               if (Input.GetKey("q"))             {                 flashOn = true;             }             }     } } 

Why don’t raytracing algorithms include the speed of light?

From what I understand about ray-tracing, it is instantaneous in its speed from the light source to the user. Is there a type of ray-tracing where the “rays” move at the speed of light or are affected by gravity? Such methods would be useful in simulating large scale systems (like planets).

Also, can the same method be applied to sound?

What light spells would generate enough light/heat to start a fire with focusing assistance?

Inspired by this question on starting a fire with a magnifying glass, I was curious if there were any spells in 5e core rules (no 3rd party) that would fulfill the requirements?

In other words, [spell] + magnifying glass or focusing element = fire starter. Note, I am not looking for spells or other mechanisms that directly light something on fire, that was covered in the other answer. The critical element is the use of the focusing element (magnifying glass or other similar object).

Greatsword with light and thrown?? (New wild barbarian)

One of the posible wild surges from the playtest barbarian Wild Soul subclass:

Shadows weave around a weapon of your choice you are holding. Until your rage ends, your weapon deals psychic damage instead of its bludgeoning, slashing, or piercing damage, and it gains the light and thrown properties with a normal range of 20 feet and a long range of 60 feet. If you drop the weapon or throw it, the weapon dissipates and reappears in your hand at the end of your turn.

By default a greatsword (other big sticks are available) has both two-handed:

This weapon requires two hands when you Attack with it.

… and heavy:

Small creatures have disadvantage on Attack rolls with heavy Weapons. A heavy weapon’s size and bulk make it too large for a Small creature to use effectively.

But if the barbarian wild surge comes up with option 7, then it seems it would gain light:

A light weapon is small and easy to handle, making it ideal for use when fighting with two Weapons.

So… going by the mechanics alone, I see no problem between a weapon being both light and heavy, since a small creature would have disadvantage and you could duel wield, but thematically I have a problem with something being light AND heavy since, ya know, there both oposite6 ends of the “how heavy” scale. I guess the important question here is how heavy is it?

The mechanical problems come with light and two-handed. Two-handed sort of rules out duel wielding unless you have more than two arms (but I’ve seen this be overruled in official books, such as when a giant wields it in one hand) but light says that it’s perfect for duel wielding. So what happens in this case?

My interpretation is that you can’t duel weild because of the weight and heftyness, but light cancels that out, but I may well be wrong.

How to have a point light with no falloff in Unity 3D?

Does anyone know of a good strategy to make point lights with no falloff, eg. anything in the radius of the light will be 100% illumination while anything outside the radius will be 0% illumination.

I want to use this as a sort of 3D line of sight drawing. The line of sight is a big sphere originating from the character’s head that I thought would be a clever idea to have that represented as a point light, however with the falloff it doesn’t correctly show where the edge of the line of site is.

I’ve tried a few solutions, such as a custom falloff package (doesn’t seem to have the options I want) and a few shaders, but I am terrible at shaders so it’s difficult for me to debug. I’ll post the shader here in case somebody can tell me if I’m being dumb, otherwise if someone can point me to a different solution that would be great. Thanks!

Here’s a shader I tried, but it just turns everything invisible and it’s not immediately obvious to me why:

Shader "Custom/No Falloff v2" {     Properties     {         _Color("Color", Color) = (1,1,1,1)         _MainTex("Texture", 2D) = "white" {}     }         SubShader     {         Tags{ "Queue" = "Transparent" }          Pass     {         Blend SrcAlpha OneMinusSrcAlpha          Tags{ "LightMode" = "ForwardAdd" }         CGPROGRAM         #pragma vertex vert         #pragma fragment frag         #include "UnityCG.cginc"         #include "Lighting.cginc"          // compile shader into multiple variants, with and without shadows         #pragma multi_compile_fwdadd_fullshadows         // shadow helper functions and macros         #include "AutoLight.cginc"          sampler2D _MainTex;     float4 _MainTex_ST;      fixed4 _Color;      struct v2f     {         float2 uv : TEXCOORD0;         SHADOW_COORDS(1) // put shadows data into TEXCOORD1             float4 pos : SV_POSITION;     };      v2f vert(appdata_base v)     {         v2f o;         o.pos = UnityObjectToClipPos(v.vertex);         o.uv = TRANSFORM_TEX(v.texcoord, _MainTex);         TRANSFER_SHADOW(o)             return o;     }      fixed4 frag(v2f i) : SV_Target     {         fixed4 col = tex2D(_MainTex, i.uv) * _Color;      // compute shadow attenuation (1.0 = fully lit, 0.0 = fully shadowed)     fixed shadow = SHADOW_ATTENUATION(i);      if (shadow < 0.5)     {         return fixed4(0.0156862745, 0, 0.23529411764,1.0); //or any other color for shadow     }      return col;     }         ENDCG     }          // shadow casting support         UsePass "Legacy Shaders/VertexLit/SHADOWCASTER"     } } 

Does a Light Cleric’s 17th level ability produce sunlight?

Does a Light Cleric’s 17th level feature, Corona of Light, produce sunlight?

It explicitly says “you can use your action to activate an aura of sunlight” however it also says “You emit bright light in a 60-foot radius and dim light 30 feet beyond that” that seems to imply it is just normal sunlight (like the spell daylight) and not sunlight.

When to roll a spot check for a gelatinous cube in poor light?

I’m new to DMing, and trying to figure out what’s fair vs. fun on when the player characters have a chance to spot a gelatinous cube. So if they are in a dimly lit dungeon, when do you have the PCs roll the unmodified DC 15 spot check?

The 3.5e Monster Manual says:

Transparent (Ex): Gelatinous cubes are hard to see, even under ideal conditions, and it takes a DC 15 Spot check to notice one. Creatures who fail to notice a cube and walk into it are automatically engulfed.

The 5e Monster Manual says:

Transparent. Even when the cube is in plain sight, it takes a successful DC 15 Wisdom (Perception) check to spot a cube that has neither moved nor attacked. A creature that tries to enter the cube’s space while unaware of the cube is surprised by the cube.

In our dungeon, I had the gel.cube hiding around a corner and the PCs had to make a spot check when they rounded the corner. The guy in front made the spot and stopped everybody from just blindly walking into it and being auto-engulfed (the 3.5e rules).

To simplify the question though, let’s say the PCs are walking down a 130 foot dark passageway with the gel.cube at the far end. Does the Dwarf get a spot check at 120 feet (120′ max darkvision), then later a spot check for the elf when dim torchlight reaches it, then at 20-30 feet when the human/halfing is within decent torch range? Or is it so hard to spot at that distance (increasing difficulty by +4 or +8 or more on the DC due to distance and a nearly invisible unmoving gelatinous cube), that they’d have to wait till they are much closer? Or do you allow multiple spot checks per character as they get closer? My thought is wait till much closer, but what is fair and fun?

This thread below talks about it vs. darkvision in 5e terms. I’m playing 3.5e, so I might go with a +4 on the DC if they try to spot it at medium range on their vision.

Is it harder to see a Gelatinous Cube with darkvision?

This thread makes it clear that it isn’t truly invisible: When do you see a gelatinous cube?

I feel a second question coming up about how many spot checks can you make as you approach something hard to see from far away, but that’s bending the rules on asking questions so I’ll leave this post with this link which might answer that question for me as I go read it:

How to use spot checks in a wilderness encounter?

Does casting light on a monsters nose blind it?

One of my level 2 players cast light on the nose of a giant constrictor snake to blind it. I had him do a range spell attack, and he rolled a 20. Fortunately for me, the snake was killed by the next player before I had a chance to make a ruling about using the light spell that way. And then we quit for the night. I say it was fortunate because I had to think about the situation. I really don’t think light is supposed to be so powerful that it can be used to make enemies fight at a disadvantage due to difficulty seeing, but it’s a smart idea so I think I should give him some chance to do something like that with it if he can, at least sometimes. I was thinking along these lines: it’s hard to hit the moving face so -(2 or 3) or whatever, on his range spell attack, but let him try. Does anyone else have experience or thoughts about this???