Our game is a multiplayer VR game.We have a in game lobby were you select weapons etc and then spawn into the match. The in game lobby gets loaded into the main scene using LoadLevelAdditive.
We disable the mixed mode directional light when you spawn in the lobby and enable it when spawning in match.
Problem is the addtive scene look way different when loaded into the main scene, here are two screens
On its own in editor, here it look as I intended
When loaded additive at runtime
Whats going on here?
This appears to be a light source giving extra lighting to your scene. Check the additive scene for light sources. Check if some gameObject has a light source attached to it (maybe the camera). Note that there's a directional light that's added by default to new scenes.
Also check that this little button is disabled (or enabled if you want):
Related
Developing a simple zombie game with day-night cycle. So, for the player to handle the night, i am making a flashlight. Modeled it, and i need a real Unity light to make it a flashlight (but it's anyways flashlight, but broken..?). The light works neither in Scene or Game window. Here i'll show you some screenshots (and a test video):
I tried clearing cache, as i found on Internet, but it only worked until i switched tabs.
EDIT for #BugFinder [30.01.2023]
Light component for the flashlight:
Switching between Point and Spot light isn't doing anything.
Your light mode is currently set to Baked. This instructs Unity to prerender a static light when you press bake lighting in the lighting menu. Obviously you don't want something static for your flashlight, so change the mode to Realtime.
We have built an app for the Hololens that has 1 or 2 3D characters in the scene at any given time. What is the best practice for adding lighting to an AR scene for headsets like the Hololens? Should the scene be lighted at all?
So here's the thing with the Hololens:
Black is Transparent
This means that any shadows on objects will make the object fade out into transparency when viewed on the real device (the emulator does not show simulated environments). As such, environments should be brightly lit from a source that is a child of the main camera (you may still use a directional light pointing from above angle) and objects should not cast shadows (as it will appear that those shadows are punching holes in objects).
This also means that you will want textures that are brightly colored as well.
Brightly lit (real world) backgrounds will exacerbate the transparency effect (as the Hololens can't reduce incoming light).
You'll likely have to experiment to find something that works best for your project.
I am doing one of Unity's official tutorials: Survival Shooter.
Unity version: 5.3.4f1 Device: Macbook, OSX 10.11
http://unity3d.com/learn/tutorials/projects/survival-shooter/environment?playlist=17144
The problem: Baking process completes almost instantly and the floor is not highlighted by a blue mesh (where highlight should mean that navmesh is calculated for there).
Here is the screenshot of it:
Then, I checked the completed scene (which was already created by Unity Team), it showed the floor fully highlighted. I just hit the bake again without touching anything and the same problem happened. So, there must be something else as I tried the original scene file without changing anything.
What am I missing here? Is there a Unity editor setting or something like that which can break the baking process?
When baking a NavMesh for your game, a crucial thing to verify is that every object which should affect navigation is marked as a Static GameObject, or at least Static for Navigation. This setting may be found in a checkbox/dropdown at the top of the properties Inspector:
It sounds like the floor object in your scene hasn't been marked as Static, meaning it won't factor into the NavMesh baking.
when I reload a game scene by clicking on play again button in Unity , the game view automatically gets dark as if the skybox lighting settings are not set at all.
The game scene plays fine for the first time , the file was saved and when trying to replay the same again,the light settings go off. Is it a lighting bug in Unity 5 version?
I had the same problem and fixed it by unticking "Auto" (for automatic baking of light maps) in Window>Lighting>Scene and clicking "Build".
The same problem is answered on the Unity website
I also had the same issue. Turn off Baked Global Illumination in Mixed Lighting section.
Check if you are Destroy()ing objects you are not supposed to destroy.
You might for example have this case:
public class LightInstantiator : MonoBehaviour
{
public GameObject lightPrefab;
private GameObject mySceneLight;
void Start()
{
mySceneLight = Instantiate(lightPrefab);
}
void OnDestroy()
{
DestroyImmediate(lightPrefab); // BUG: you destroy the Prefab instead of the instance
}
}
This example script instantiates the Scene light for me, and destroys it again when itself is destroyed. This is perfectly legit, but I accidentally have introduced a bug: where I meant to destroy the instantiated light (mySceneLight) I actually destroy the Prefab.
On first start everything seems fine, light and all. When stopping and restarting the scene however, Unity will feed the (previously destroyed) Prefab into my script, which will then be unable to instantiate a functioning light: the scene stays dark.
Something along these lines happened to me once. I don't know if this is still possible, but it might be worth a check.
Afterthought:
It may even be easier. You might accidentally modify the prefab light in code by setting its intensity to 0 during your first run. As it is a prefab, Unity might not reset that, and on your second run, the prefab light intensity is still 0.
I'm doing an augmented reality application using Unity3D and Vuforia. For each gameObject in my augmented reality scene I add a Light component to it and define it as a DirectionalLight.
In this scene the gameObjects are iluminated, but when I change to another scene (not destroying the gameObjects) they are not.
I already checked and they still have the Light component, but are not iluminated for some reason.
Do you guys have any clue of what might be the problem?
P.S.: The second scene is a normal scene with no interaction with the phone's camera. And the projection on the camera is orthographic.
Without more detail it's difficult to say with certainty, but the first thing I would suspect is whether you've culled layers on your lights or your cameras.
What "Layer" are the lights on? Are the cameras set to ignore these layers?
What "Layers" are the lights set to illuminate? Are the objects on these layers?