Unity prefab clone is not visible in runtime - unity3d

I have two prefabs which have sprite renderer,collider,rigidbody2D.
I instantiate 20 of their clone separately and transform in runtime. The clone are created in object panel still it in active state but not visible in both game and scene I need help.am a begginer

There could be many reasons for this
Object out of view:Your game object could be placed outside the view frustrum(not in view of the camera)
game Object inactive:May be some of the attributes are inactive thus the visual aspect of it is not visible try dragging the prefab on the screen outside debug mode
Out of canvas:May be you have a UI element outside the canvas
there may be soo many reasons for it if you could put some screenshots or something to help us with your problem may be we can pin point it

Related

why am I losing all gameObjects in unity when I have more then one scene

I am trying to create a tower defense game and I made a menu scene and a level01 scene.
Now when I create some objects in the menu scene, and go to the level01 scene, I lose all my objects in my menu scene. I don't know what is going on. I have tried to create a new menu scene and duplicating my level01 scene, but it doesn't work.
You can use DontDestroyOnLoad or you can add multiple scenes and never unload the menu scene.
SceneManager.LoadScene("OtherSceneName", LoadSceneMode.Additive);
The use of a scene, as its name implies, is to prescribe a different scene and arrangement. If you can design the gameplay inside a scene and deactivate them beforehand instead of adding objects. This will make the code more consistent and will prevent future problems.
You can mark objects to keep them between loading scenes by DontDestroyOnLoad(myObject). Here is the documentation with sample code:
Object.DontDestroyOnLoad

How to solve "No cameras rendering" in Unity?

I am entirely new to Unity. I have a task to work with a tool in Unity. I'm not sure the "Game" is where I should work or the "Scene"? this is how my "Game" tab looks like, but I saw animations in the "Scene" tab. for changing parameters of animation, I should come back to the "Game" tab to change and again go to the "Scene" tab to see the result. I think something is wrong, and I should see the animation in the "Game" tab. Am I right?
It was confusing for me to explain my problem cause I have no idea!
It's very confusing what is happening in your Unity scene.
I assume either you have a disabled camera object or no camera at all.
Search the hierarchy for a MainCamera object and enable it. The game view is rendered from cameras in the application. If you cannot find a camera gameobject, try adding a camera (Gameobject>Camera). If you could find a camera gameobject, you should also check it's Camera component has target display set to Display 1.
In the Scene View at the top left, you can click 2D View. Then you can select the canvas in the hierarchy and press "F", while your mouse is over the scene view, to focus it there. In the end, you should be able to see the canvas in the scene view just as you can in the game view.
In fact, you don't need a camera in the scene to render UI elements, which is quite confusing. So if you don't need to solve the "no camera rendering" problem, as long as there are no 3D objects you want to draw. Keep in mind that you will probably need to manually place an audio listener if you want to hear something at some point.
In your hierarchy window search box write this :
t:Camera
And see if any will show up. The camera needs to be enabled if there is one present. If there is none, then you need to create one from GameObjects -> Camera.
As above answers indicate, there is a missing Camera object. Please keep in mind also that a disabled parent object will affect child objects. This was my case, my Camera object was a child object for a XR Ring object which was disabled and I was getting the "No Cameras rendering" message.

Unity deforms every prefab that I create

I have problem with Unity prefabs. Every time I create a nice looking UI in main scene and I want to store it as prefab for later usage if I open this prefab it's deformed(random cliping, moved UI elements in different directions, ... such a mess). If I try to fix this prefab in prefab editor to make it nice looking like before and then if I insert this back to scene it's totally unusable. It creates bigger mess than before in prefab editor... I don't know what to do. Editor throws no errors btw.
In first image is nice looking UI(example already created). In 2nd image is prefab editor. Text is totally out of panel and 3rd is from back in scene (means removed old one UI and place stored prefab from folder) the panel is gone.
Imgur - images are orded by scene to prefab editor and back to scene
On those images you can see a 3 elements... but if I make more complex UI, it's clipping through each other in prefab editor and also back in scene.
Unity version: 2019.1.7f1

can't interact (in game view) with objects displayed by secondary camera - Unity

I have two cameras that occupy different spaces in the Game view. The problem is that I can interact with my object shown by the main camera, but when I move this object (in scene view) to make it appear in the visual field of the second camera, the object is displayed in Game view but I can't interact with it (the object is a scroll Rect btw) through Game view. Seems to have a very simple solution but I couldn't find it.
Here are the parameters of both cameras:
Main Camera:
Pretty sure you can only interact with the current MainCamera in Unity.
If you could explain what you're trying to achieve with 2 cameras maybe we can help you find a better solution.

Can not see game objects after change their layer in reference prefab in Unity

I'm creating a 2d game using Unity and get the following problem. When I change the layer of some game object in its reference prefab, I can not see that game object in the scene window.
In Unity, cameras can view one or more layers simultaneously. If you have created a new layer, be sure that at least one of your cameras is set to render it. You may have placed your object on a layer which is not currently being rendered on any of your scene's cameras.
Maybe you have set some layers as invisible. You can check visible layers in a popup list "Layers" at top right corner of Unity Editor window.