I am building a 2D proyect in Unity, when I play the game and try to go from the play button (from MainMenu UI) to the second scene ( 1 on the index value) y keeps giving me the error of display 1 no cameras rendering. I have experienced this error before and the problem was that the scene was not on the build settings but this is not the case. If anyone could help me I will be really appreciated.
You do not have active GameObject with Camera component on it in the second scene. Use rightclick in the Hierarhy then Camera.
You can open Game window without starting the game. You can see what this scene will look like in runtime.
Related
I just purchased the A* Pathfinding asset from the Unity store. I have a few questions on getting it set up. My current problem is the AI Destination Setter will only follow the player's "0th" position. It goes to wherever my player starts at and does not update to the current position. (See Image below)
I have a game object prefab called "Essentials Loader" that I drag into every scene. This has things like my Player prefab, Game Manager, UI Overlay, Audio Manager, and other things that will be needed in every scene. I set it up this way for two reasons. 1. It prevents me from forgetting to drag in anything important into a new scene. 2. If I completely re-do the player prefab I only need to swap it out in the Essentials Loader and not in every single scene.
The code in this Essentials Loader checks for accidental duplicates and deletes them to prevent unwanted issues between scenes.
Temporary Solution: I have taken the player prefab out of the Essentials Loader and dragged it into the scene. Now when I assign the "AI Destination Setter" Target transform to the player from the scene and not the project window, it works just fine and follows the player correctly.
My question is: is there a way that I won't have to do it this way? I do plan on completely changing the player prefab a little while down the road and I would hate to have to make that change in every single scene. I would like to still have the player prefab in the Essentials Loader and have the enemy still follow me.
I'm trying to restart my game when the player loses, I play a coroutine which makes the player ignore collisions and falling off the platforms. Then when the player click a button, the same scene is reloaded.
SceneManager.LoadScene("GameScene")
But when the scene loads again, the player is still ignoring collisions and falls, it's like the scene is loaded but not the same way when the game is played for the first time.
¿How can I reload the scene properly without closing the aplication and opening it again?
Thank you.
The problem is that you are using Physics2D.IgnoreLayerCollision for this.
This property is global, it affect all scenes, and not related to the specific scene. What SceneManager.LoadScene resets is only property related to the specific scene or the objects in the scene.
You have 2 options here:
Don't use IgnoreLayerCollision. An alternative may be, for example, to disable all colliders on the player. You can use GetComponentsInChildren for example to find all the colliders.
Reset IgnoreLayerCollision manually.
This is the first time I try to use animations in Unity so my friend built a campfire in blender and also made animations so the fire seems like it's moving. When he converted it to fbx and sent it to me, I downloaded the fbx, dragged it to the Unity project. I thought that the animations should work and I should see the fire moving when I play the game, but unfortunately the fire seemed like it's a not moving object. I screen recorded it so you will understand the problem better. If anyone knows how to fix this problem, it will really help me. Thank you!
First of all You have to check FBX import settings to be sure, that animation is exist. Select your fbx in Unity and switch to 'Animation' Tab in Inspector. If Animation is exist, You'll see animation import settings. Be sure toggle 'Import Animation is active':
If Your FBX does not have animation, in animation tab You'll see message 'No animation data available in this model'.
If FBX is okay, the next step is checking your fire gameobject. It must contains Animator component with some animation controller. This animation controller will play anim clip from your FBX.
But first af all I recommend your check this: Unity Animation Manual
Ive just started developing for the windows mixed reality headset in unity and it seems to be going well; until i build the program.
The point of my game is simple, one player navigates through a maze in VR and another watches the monitor and guides them through.
In the unity editor under the "game" tab, the cameras work as expected. I used RenderTextures to display two cameras (one of the VR view and one an overview of the entire maze) onto a canvas, which was the game view.
However, when i build my game the only thing that appears on the monitor is the VR's perspective.
I have set the target eye for the vr camera to "both" and the main camera to "None (main display) as others have suggested, but no luck.
Is this a small error ive overlooked or is there a larger problem?
Alex.
I have a 3d world the player can interact, I'm wanting the player to pick up a gameboy and play a game on the gameboy.
I'm wondering how I can render another 'game' on the gameboy the player can play with while still being in the world, meaning it's a game in a game. I tried doing this with Cameras, but I'm stuck as I don't seem to understand the core concept behind rendering a game there. I know I could render a canvas using UGUI but I don't think I can make a physics based game on UGUI?
Would love some help!
You'll probably need a Render Texture. And the game scene of the gameboy should be the same scene as your main game, it just has to show another location in the world.
Try to implement it, and come back if you can't figure out how to implement something.