Building light in code

Hello, I think it’s a simple issue. Yesterday I started to know, how to use C++, not only Blueprints in UE4. So the question, I have a simple code, that creates static mesh and point light. Then from that class, I create a blueprint and there define the mesh and light respectively(adjust light, change mesh). When I open viewport it works all fine, the light shines bright, but when I try to play, the light becomes invisible. And when I create the same blueprint, just from editor, not from the code it works just fine. Btw the checkbox “Hidden in Game” is off. Any advice would help :slight_smile:

Since your light is generated dynamically, it should be set as movable. If not, that’s probably the reason it’s not working. Static and stationary lights need to be built in advance.