How do I make object bright under lighting but still effected by ambient light?

I want my character to lighten up in the lighting and I still want to shadow behind it, It should also be affected by ambient light so that it would stay dark when it’s not inside the light.
屏幕截图 2023-11-25 005444

屏幕截图 2023-11-25 013823

I came up with an idea but it might be too expensive for multiple objects
The idea is to create a lighting mask with the same shape on top of the object, and change the brightness of the mask based on the distance from lighting, so each lighting object will cast a ray toward my object and save the data in an array, and then change the mask based on the shortest distance in the array.
But this is not idea for project with constant enemy spwan, is there any better way to do it?

Just relize there a condition to pick nearest object, maybe this will just work…

I’ve been trying and struggling to come up with a solution for this myself.

I have doors in my game that cast shadows, but I also want the doors to be visible when lit by other lights. Hopefully you have better luck than I have.

Sadly the only option that I know of is to have another layer above the lighting layer, then sync the cameras od the enw layer and your mainngsme layes

Duplicate the objects you still want to show up. Set their position and rotation to match the real object and tou should get the erfect you are looking for.

@How do I sync the cameras of the new layer and my main game layers if I understand correctly?

There’s a “Copy camera settings” extension, I believe. But also you can just set the x/y position of the camera for the new layer (using the “Change X position of camera” action) to CameraX(“Yourlayerhere”,0) and same for Y)

I been struggling on this for days and still did not found a solution

Please inform me if I did anything wrong, I would so appreciate

Your camera copy settings are inverted. You want to be copying the base layer to the lighting mask layer.

I really quickly added another star-style object to the Lights example in the engine, and synced it up with one of the star polygons.

Star Object properties (showing it on layer):

Scene editor:


Well, it’s not like the effect that I’m looking for, I would like the object to be just like a normal object under lighting, but also shadow. the stars in the example are not affected by the blue lighting, but still thank you very much for the tip tho :slight_smile: