Complete noob trying to follow a tutorial to create a moon in the night sky. I’ve created the directional light actor in the world and it is in the world outliner tab named “Moon Light”. Hovering over it the tooltip says “ID Name: MoonLight”. Not sure why there is no space in the tooltip. I did edit that name a couple times trying to fix things.
My problem is trying to create a reference to this actor in the blueprints. I’m trying to add it to the sky sphere blueprint by creating a directional light variable and naming it “Moon Light” or “Moon light”. Lower case, with and without space. None of them work. Hovering over that variable in the blueprints I see “Current value = None”. why? I see that the default sun in the sky has been named “Directional Light Actor” in the skysphere blueprint but is referencing “Light Source” in the world outliner. They aren’t even the same names but the blueprint knows to reference that one. What am I doing wrong? It doesn’t let me set a default value, and I don’t see any other way to select which directional light actor I want that variable to reference. I’m naming my variable in the blueprint the same name as the ID Name in the world outliner but it’s still not referencing it.
The name of actors in Unreal has very little to do with anything. They’re not used (or at least, should not be) as references since they can change arbitrarily.
The only type of blueprint where you can directly reference an actor that is in your world (level), is in the Level Blueprint. You’ll notice this if you select an object in your world, open the level blueprint and right click anywhere.
But doing this same thing in another blueprint (not a level blueprint) will not show the same option, because non-level blueprints cannot directly reference objects that are in a level, otherwise they would only be usable in that level (which would defeat the purpose of non-level blueprints).
By creating a Directional Light variable in the Sky Sphere blueprint, you are simply creating a “slot” for a Directional Light object, but the step you’re missing is filling that slot with the actual object in your world. That’s why it says “Current Value = None”, because you haven’t assigned a value to that variable, you’ve simply created an empty variable of the Directional Light type.
If you select the Sky Sphere blueprint in your level (in the World Outliner), you’ll notice it has a bunch of values you can edit in the Default section. This is how the Directional Light Actor (the one already present in the Sky Sphere by default) is assigned. You want to do the same thing with your new Moon Light.
Create a Directional Light variable in the Sky Sphere BP (or duplicate the existing one) and make sure the little eye to the right of the variable is displayed (or check Editable in the variable’s details). This will expose it in the list of settings you can edit when the Sky Sphere is selected in the world. Then all you have to do is assign your moon light as the value for that new variable.
After that you can do whatever you want with the variable in the Sky Sphere BP and know that it’s actually referencing your moon light in the level.