当两层连接时,刚体在没有输入的情况下移动 [英] Rigidbodies moving without input when two levels are connected

查看:25
本文介绍了当两层连接时,刚体在没有输入的情况下移动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 Unity 中制作一个游戏,您可以在其中碰撞按钮以打开门并进入下一个级别.当两个关卡断开时,如第一张图所示,它运行良好,玩家和门在施加力之前不会移动.

I am trying to make to make a game in Unity where you collide with the button to open the door and access the next level. When the two levels are disconnected, like in the first picture, it functions perfectly and the player and doors do not move until a force is applied to them.

但是,如果我将其更改为将两个级别连接在一起,就像第二张图片一样,玩家和门开始缓慢移动,这对我的游戏来说是一个很大的问题.

But, if I change it so that the two levels are joined together, like the second picture, the player and doors begin to slowly move, which is proving to be quite problematic for my game.

我认为这与我的脚本无关,我认为这只是与 Unity 相关.

I don't think this has anything to do with my scripts, I think this is just to do with Unity.

我不明白为什么只有当级别连接时才会发生这种情况,所以如果有人有任何想法或修复,我将不胜感激.谢谢!

I don't understand why this is happening only when the levels are connected, so if anyone has any ideas or fixes, I'd greatly appreciate it. Thanks!

推荐答案

也许它与对撞机有关,如果有连接到关卡的连接部分的话.您可以尝试将它们在一侧或两侧缩短一点,看看是否有效.

Maybe it has something to do with colliders, if any are attached to connecting parts of the levels. You can try to shorten them a bit on one or both sides and see if it works.

这篇关于当两层连接时,刚体在没有输入的情况下移动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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