言語: 日本語
  • C#
  • JS
  • Boo

スクリプト言語

お好みのスクリプト言語を選択すると、サンプルコードがその言語で表示されます。

Rigidbody2D.AddRelativeForce

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Sumbission failed

For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Switch to Manual
public function AddRelativeForce(relativeForce: Vector2, mode: ForceMode2D = ForceMode2D.Force): void;
public void AddRelativeForce(Vector2 relativeForce, ForceMode2D mode = ForceMode2D.Force);
public def AddRelativeForce(relativeForce as Vector2, mode as ForceMode2D = ForceMode2D.Force) as void

Parameters

relativeForce Components of the force in the X and Y axes.
mode The method used to apply the specified force.

Description

Adds a force to the rigidbody2D relative to its coordinate system.

力は X および Y 軸方向の別々の成分として指定され(2D 物理挙動では Z 軸方向がないことに留意)、オブジェクトは 力 = 重さ x 加速度 の法則に従って、加速が加えられ、重さが大きいほど特定速度まで加速させるのに、より多くの力が必要となります。 See Also: AddForceAtPosition, AddTorque, mass, velocity, AddForce, ForceMode2D.