Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Game Object Appears in Scene View but not in Game View

Tags:

unity3d

Seems like I am missing something here, using latest version of unity and I am instantiating a gameobject on click.. It appears fine in scene View but not in the game view?

I have googled it and tried all those responses.

I checked the layers at the top right of the screen, They are all showing, Also the z value is lower than the cameras' But honestly i have tried having them at nearly all z positions.

The game object i am spawning is a sprite with a rigid body, but that shouldn't matter right? It shows up in scene view and game view should just show me what the scene does?

Any ideas?

like image 228
MIke Avatar asked Feb 12 '15 04:02

MIke


2 Answers

This is a pretty old question but I just had the same issue. I solved it by playing around with the camera clipping planes.

To test if this is the case, hit play and when the object is supposed to be in view, hit pause.

Select the camera from the hierarchy and try altering the clipping planes - "Near" and "Far" properties from the inspector.

If this works then don't forget to make the same changes again after the game has stopped running - They reset to the way they were before you hit play.

I think this is to do with the distance from the camera that objects have to be, in order to be rendered. Its probably useful with fog etc. but I'm kinda new to Unity so could be wrong.

I tried posting a screenshot but apparently you're not allowed to help properly if you're new on here :s. probably to prevent spam etc.

Anyway, hope this helps someone out there :)

Unity Screenshot

like image 126
Joekomino Avatar answered Oct 04 '22 22:10

Joekomino


On the Inspector of your MainCamera or Camera, you will find something called "depth", just set it to the same value as your field of view and it will work :)

like image 30
user5175901 Avatar answered Oct 04 '22 22:10

user5175901