i just added a spotlight to my scene and i cannot see it at all, here are the settings,
i only have 2 lights in the scene, the main directional and this spot
any ideas anyone what i’m missing? thanks
i just added a spotlight to my scene and i cannot see it at all, here are the settings,
any ideas anyone what i’m missing? thanks
Do you use a custom shader for the objects in scene? Maybe it doesn’t support additional lights (if yes).
ah, i turned the brightness up to 50ish and i can see it, or at least i see the effect of the light, no the light itself
i’m actually trying to make a laser dot for a laser pointer so i have it aiming directly at the camera, but i’m sensing that’s not the way to do it
any advice
BTW, i already have the pointing at the camera stuff working, i can see in the scene view the the light rotation follows the camera. i already had it working fine with a red sphere but that doesn’t work in the dark
Perhaps using emissive decals (if it’s added to URP) is another way to do this, but spot lights are easier to control.
It should be a performant way if the shadow is off.
ok, i got it working, the problem was i was shining the light at the camera, like you would shine a flashlight in real life into your eyes (if you want to go blind!). i switched to shining away from the camera and setting the position 99.5% of the way to the target and it works (at least in low light conditions, which is true of a real laser pointer anyhow, so i guess its done.
i have a 8 degree cone size and intensity of 5
if anyone interested, he’s the pionting code
private void Update()
{
_laserSightDot.gameObject.SetActive(_laserSightOn);
if (!_laserSightOn )
return;
RaycastHit hit;
Transform laserSightFront = transform.GetChild(0);
if (Physics.Raycast(laserSightFront.position, laserSightFront.forward, out hit))
{
_laserSightDot.position = Vector3.Lerp(hit.point, _playerHandler.transform.position, 0.03f);
var lookPos = _laserSightDot.position - _playerHandler.transform.position ;
_laserSightDot.rotation = Quaternion.LookRotation(lookPos);
}
thanks