我想在我的Unity Platformer游戏(2D)中建立一个Jumppad。我以为如果我的播放器与跳板发生冲突,只添加一个Addforce或velocity会很容易,但这有一个问题。
我的求助者不是以45°的角度飞行,而是首先在X轴的方向上被推,然后在Y轴的方向上被推。
如果玩家与Jumppad发生冲突,则bool sprungFlächeBerührt为真。
if(SprungFläche.sprungFlächeBerührt)
{
rb.velocity = new Vector2(10f, 10f);
SprungFläche.sprungFlächeBerührt = false;
}发布于 2019-07-15 16:03:26
很奇怪。可能是个窃听器。试试这个:
rb.velocity = new Vector3(10f, 10f, 0f);https://stackoverflow.com/questions/57030802
复制相似问题