【发布时间】:2018-11-09 14:41:07
【问题描述】:
大家好,我想问一下,当我的角色撞击物体时,如何设置具有不同方向的 .addforce。我的角色在左右踢腿,我希望物体以不同的力量向不同的方向移动。而且我希望我的角色在运行时不会撞到对象。
Here is my character and I have 2 box collider for the feet and for the trigger
这是我的原力代码。
Public void Sipa()
{
if (canSipa == true)
{
_pitcha.GetComponent<Rigidbody2D>().AddForce(new Vector2(1000, 5000));
//_pitcha.GetComponent<Rigidbody2D>().AddForce(transform.right * kickForce);
}
}
【问题讨论】:
标签: c# unity3d character collision-detection