I just started Unity (following a course from Udemy). I've run into this issue where any object/image I add is always added behind my background...
I'm not sure how to fix it so the spaceship (seen extending past the background) is in-front of the background...
I've tried playing with the layers, but that didn't work...
It was because my Galaxy had a z index... So the camera was placed in between the the player and galaxy. Setting the z to 0 fixed it.
z value of position and hierarchy position both can be the issue.
Also you can give it sortingLayer :)
Related
Could anyone tell me why the Main Camera is not showing what my actual Scene is showing ?
Any problem in the hierarchy or ?
enter image description here
Cheers
I tried to google my problem but didn't succeed to find any solution. For info I'm using a tile palette
Your camera's z is behind your tile pallette - you're looking behind it. Move the camera back.
I'm quite new to Unity, so I'm sorry if this is a basic question. I've been trying to set up the UI for a mobile game, but I'm not quite sure how to make the UI lock it's position, no matter the screen size. I've tried using anchors (though I don't fully understand how to use them properly), I've tried using a canvas scaler, I've looked at the Unity document and I just can't seem to find an answer. The buttons are off screen/half off the screen when I build the game to my device/switch screen sizes in the game view. Does anyone know how to fix this?
You can set your anchor point by selecting the UI object (such as a button) and then clicking here and selecting the right anchor point. You can also press down shift to set the pivot and/or alt to move the object to that point at the same time. The object should now be anchored to that point and keep its position even if the resolution is changed. You can set a precise position from the inspector, too. Simply adjust the Pos X and Pos Y variables. It will still adhere to the anchor point.
Note that you might have to play around with the Canvas object's UI Scale mode and its settings to get the right setup.
New to Unity.
I think it's quite weird. What I was trying to do is to make the words on the newspaper flow like water. I created a plane for the newspaper, and I added a 3D Text object.
It worked well at first but when I rotate the camera(not the camera in the scene, but the camera with which you do all the editing), the text simply disappeared at some angles (particularly from below). The main camera had the same problem. It saw the text at some angle and couldn't at some other. I am sure that the texts are positioned right in the viewing frustum.
Some screenshots:
The text can be seem from here
And it cannot be seen when the camera moves a little bit down
Or from another angle, the text is selected
It is in the viewing frustum. But the main camera does not see it
It seems like your text and background are on the exact same coordinates (for example 1,1,1). By doing so, you let Unity decide which is more important to show on the foreground, which makes it dissapear sometimes.
Try to move your text a little forward (for example 1,1,1.001), so it seems to rest on, instead of in the newspaper. Most of the time, that should fix the problem.
Is there some kind of transparency on the object?
Try to set it to opaque to check if this is the problem
When Unity builds a VR project, by default it is set to make the two views stereoscopic. It slightly offsets the camera position of one eye to give the user a sense of depth.
For example a square will appear slightly to the left on the right view compared to the left view.
I want to make the camera truly monoscopic by removing the offset that is created when i build the project. Each camera should render all objects in exactly the same position for both eyes.
One of things i tried was creating two camera and setting them to the left and right eye. Then i manually set the position/rotation of one camera until it looked monoscopic
It worked fine on my pixel phone, but as soon as i put the project on my test phone i noticed that the difference in resolutions messed up the view i was going for. The blocks were not in the same position when i looked at both renders.
If anyone has any solutions or ideas as to how i can go about this, i would greatly appreciate it.
Thank you!
You can still use 2 cameras, but instead of offsetting them, you can just make the width of the camera half.
Make 2 cameras, set their positions to exactly the same.
On the left eye camera, set the width to 0.5 and the x position to 0.
On the right eye camera, set the width to 0.5 and the x position to 0.5.
You should now have 2 cameras rendering the exact same thing, but twice across the screen, with no sense of depth.
In the scene view when I zoom in past a certain point all the sprites (apart from one) disappear and it makes it near impossible for me to edit them because they become too small to see clearly.
This only just started happening everything was fine before and I don't think I have really changed anything that could have affected their ability to show when zoomed in.
The z positions have to be same as that of the canvas I am using
Press the F key a couple of times after selecting the sprite... it's for focus or something after you see it focus ...you will be able to zoom in endlessly to edit this is for sure a bug....I tried restarting unity first..then I tried adjusting the clipping low rate on the camera that is usually 0.3 to pure 0...and that was not it... the F key always gets it done I don't know why...also I changed the cameras near clipping plane back to 0.3 because it was not the issue.