简体   繁体   English

游戏视图显示与场景视图不同?

[英]Game View Displaying different than Scene View?

Scene View: https://i.gyazo.com/421de90843c4f77202f982ea221efecb.mp4场景视图: https://i.gyazo.com/421de90843c4f77202f982ea221efecb.mp4

Game View: https://i.gyazo.com/ad3209bc82e0690192f97e24e3fd3eb1.mp4游戏视图: https://i.gyazo.com/ad3209bc82e0690192f97e24e3fd3eb1.mp4

These are the 2 gifs of what is happening, if you don't want to click them, I can summarize what's happening.这些是正在发生的 2 个 GIF,如果您不想单击它们,我可以总结正在发生的事情。 In the game view, im teleporting around, and in the scene view, i move around fine.在游戏视图中,即时传送,在场景视图中,我可以很好地移动。 Does anyone know why this is happening?有谁知道为什么会这样?

Your player isn't teleporting around.你的玩家没有四处传送。 It is moving smoothly as you can see in your scene view.正如您在场景视图中看到的那样,它正在平稳移动。 You can also confirm this by looking at the x and y co-ordinates of your player object in the Inspector, and I'm sure you'll see that the values aren't jumping around wildly.您还可以通过在 Inspector 中查看播放器 object 的 x 和 y 坐标来确认这一点,我相信您会看到这些值并没有疯狂地跳跃。

What's happening is that your camera is flipping around the axis as your player changes direction, which is making it look like your player is jumping around relative to the black box.发生的情况是,当您的玩家改变方向时,您的相机围绕轴翻转,这使得您的玩家看起来像是相对于黑匣子在跳跃。 If you notice, you can see the camera icon popping in and out in the background of clip of from the scene view you showed.如果您注意到,您可以从您显示的场景视图中看到在剪辑背景中弹出和弹出的相机图标。 If you check the position of your camera in the inspector, I'm sure you'll see the values jumping as your character changes direction.如果您在检查器中检查相机的 position,我相信您会看到随着角色改变方向而跳跃的值。

Check your code that's controlling your camera and I'm sure you'll find your bug.检查控制相机的代码,我相信你会找到你的错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM