- Home /
Mesh not showing in camera
Hi all
I have an orthographic camera and I build meshes and assign materials to them to simulate 2d graphics.
I've been having a lot of success with this approach, however I have now run into a situation where one mesh doesn't show in camera.
You can see the pink arrow in my editor view, but in the camera preview (which is identical to the actual game camera) it is gone.
I've played with my culling masks and render layers to make sure that isn't the issue. Other than that, I'm simply not sure how to debug this.
Does anyone have any suggestions on why the mesh isn't showing?
Thanks, Ves
Does you pink arrow have a higher value of position.z than the camera's position.z? If not, then that is your problem. From what I can see in the screenshot, it's possible to be that problem.
I don't think that's the issue. Here's another picture from a different angle:
do you use the same components (mesh, scripts, shaders, etc) for both objects you have on the editor?
Admittedly the object in the foreground is a little different to the one in the background. This is my scene with more planes that are identical to the icon:
http://i.imgur.com/36olVQy.png
The inspector:
http://i.imgur.com/5FkGw$$anonymous$$0.png
Now, interestingly, If I rotate the scene camera to a certain angle I end up with this:
http://i.imgur.com/pNd2bhz.png
Notice how the icon has been cut away by the furthest back plane? I figure this is probably an issue with the transparency sorting method of the scene-camera though
If those two objects have something different, then it's obviously something that has to do with those differences. I can't figure something out right now.
Answer by VesuvianPrime · Jul 10, 2013 at 05:12 PM
So I slept on the problem, and found the issue was that the GameObject transform position was set outside of the camera rect. I'm not sure WHY this was stopping my geometry from rendering, but it's solved the issue for me.
Hey Vesuvian, I figure this is a very old question but I thought you might want to know what the problem was (I think!). An orthographic camera, which is what you have there, will only render within its view box.
Thanks Cowtrix, I think this still begs the question of why it only goes by the transform and not the screen bounding rect.
Answer by frugoman · Dec 13, 2015 at 03:58 PM
I'll post this in threads that presents the same issues, cause i saw that there is a lot of them. In my case, it was the animator that was presenting some wired bug, that it makes my gameObject not showing in my android device... i checked with a simple boolean if the object, mesh renderer, children, parent, and they were all active, and not showing anyway... (I also checked that the position was correct, and it was..)
so i disable the animator from the object that wasnt showing and now i can see it... try it out. I hope that this helps someone, since i had no idea what to do when i run through this issue I'm, in Unity 5.3
Not sure why it is happening but yeah I couldn't see my gameobject until I disabled the animator. This is weird and the most annoying though as I have lost my animations on my player.
But is it the final solution frugoman? Have you find a way to play your animations?
Unity 5.3.2f1
To fix the problem you need to enlarge the bounds(extents) on the skinned mesh renderer until the Camera renders it.
Answer by Tactical_Beard · Feb 24, 2016 at 01:07 PM
For those who get this in the future, you need to enlarge the bounds until the Camera renders it.
Just check the "Update When Offscreen" option of skinned mesh renderer component
Your answer
Follow this Question
Related Questions
How do i orbit the camera around a mesh using mouse 3 0 Answers
How do I check if the mouse is over a VISIBLE vertex? 1 Answer
Move gameobject pivot 6 Answers
Front Culling 1 Answer