游戏对象出现在场景视图中,但不在游戏视图中 [英] Game Object Appears in Scene View but not in Game View

查看:153
本文介绍了游戏对象出现在场景视图中,但不在游戏视图中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

似乎我在使用最新版本的unity在这里丢失了某些东西,并且在单击时实例化了一个游戏对象.在场景视图中看起来不错,但在游戏视图中看起来不错吗?

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.

我检查了屏幕右上角的图层,它们都显示出来了,而且z值也低于摄像头.但是说实话,我尝试将它们放置在几乎所有z位置.

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?

有什么想法的人吗?

推荐答案

这是一个很老的问题,但我遇到了同样的问题.我通过玩弄相机裁剪平面来解决它.

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.

我认为这与要渲染物体必须距相机的距离有关.它可能对雾等有用.但是我是Unity的新手,所以可能是错误的.

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 :)

这篇关于游戏对象出现在场景视图中,但不在游戏视图中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆