私の悪い英語でごめんなさい。次のようにラグドールに力を加えたい:
if (Physics.Raycast(this.transform.position, playerCamera.transform.forward, out hit, fireRange))
{
if (hit.collider.tag == "Ragdoll")
{
hit.collider.gameObject.GetComponent<ForcePush>().OnRayPush(this.transform.position, hit.point, 6000f);
}
}
public void OnRayPush(Vector3 firePos, Vector3 hitPos, float pushForce)
{
Vector3 incomeVector = ((hitPos) - (firePos));
incomeVector = incomeVector.normalized;
rigidbody.AddForceAtPosition((incomeVector) * pushForce, hitPos);
}
ラグドールをプレイすると、スクリーンショットのように歪んでいます:
理由はわかりません。力が強すぎる?
でも強く投げたい。この安定性の問題を解決するにはどうすればよいですか?
助けてください。
ありがとう