• Welcome to AtomicTorch Studio Forums.
 

Would like to add a light source to new walls

Started by MightyMonte88, December 04, 2020, 02:59:19 PM

MightyMonte88

I added a new structure tier, made from a new resource called refined pragmium. How can i go about giving the walls/ floors a slight glow? I've seen some other objects in game (pragmium sources) have a slight glow and it would be neat to add that affect to these walls/floors being that they are made of pragmium.

ai_enabled

#1
Hello!
You can create a light source component easily. Here is an example https://github.com/AtomicTorchStudio/CryoFall/blob/4a652eb58121d9ff37711e2ee7323c6cae94d09c/Core.cpk/Scripts/StaticObjects/Structures/Decorations/ObjectDecorationStatuePragmium.cs#L34
You can pass a scene object or a world object in place of it.
The best place to add this piece of code is in the ClientInitialize method override in your new wall class.
It's best not to make it as large as in the sample above. The walls are usually built close and in a significant number so they may cause rendering performance degradation when you add that many large light sources.
First, experiment with a very small light source to select the best light position offset, then adjust its size.

Regards!