Version: 2017.3
public JointMotor motor ;

説明

モーター( Motor )により角度/秒が設定された速度となるように力を加えます。

The motor tries to reach JointMotor.targetVelocity angular velocity in degrees per second. The motor will only be able to reach targetVelocity, if JointMotor.force is sufficiently large. If the joint is spinning faster than targetVelocity the motor will break. A negative targetVelocity will make the motor spin in the opposite direction.

モーターが出力できる最大のトルクが force です。0 の場合、モーターは無効化されます。

The motor will brake when it is spinning faster than targetVelocity only, if JointMotor.freeSpin is false. If freeSpin is true the motor will not brake.

See Also: useMotor, JointMotor.

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { void Start() { HingeJoint hinge = GetComponent<HingeJoint>(); JointMotor motor = hinge.motor; motor.force = 100; motor.targetVelocity = 90; motor.freeSpin = false; hinge.motor = motor; hinge.useMotor = true; } }

モーターを変更しても、モーターは自動的に有効化されません。

spring が有効になっている場合、motor を有効にすると springオーバーライド します。motor を再び無効にした場合、spring が有効になります。

Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961