I have a custom player pawn class which has a spotlight member which acts like a miner’s helmet light. The class member is a USpotLightComponent. I instantiate it in the class constructor like this:
The light appears to always be pointing vertically downward as the surrounding textures render very darkly when looking up, and render properly when looking down.
I printed out the Z component of the light direction, and it does seem to be changing as expected. Logging m_light->GetComponentRotation().Pitch also reports the correct values.
However, when I look directly upwards, the view is very dark. When I look directly down the view looks properly lit, and when I look horizontally, the view looks like it is lit from below.
So I tried narrowing the light beam and lo and behold, it turns out that the light is moving perfectly as I rotate the viewpoint. It’s fine…so why are the textures rendering so differently at different angles? The same material is used for everything (this is a work in progress), so with the light at the same angle relative to the surface it should appear the same. It is as if the dynamic lighting is applying extra light when looking down, or rendering the light as if it were pointing down instead of in the light’s actual direction.