お好みのスクリプト言語を選択すると、サンプルコードがその言語で表示されます。
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スプリング(Spring)はスプリングおよびダンパー(スプリングの減少)のフォースによりターゲット角度に到達しようとします
/spring.spring/ の力によりターゲット角度に到達しようとします。大きな値にするほどスプリングはより速くターゲット位置に到達します。 /spring.damper/ の力により角速度をダンパー(スプリングを減少)させます。大きな値にするほどスプリングはより遅くターゲット位置に到達します。 スプリングは /spring.targetPosition/ のターゲット角度を目指して、残る角度に相対的な度単位でに到達しようとします。ボディ間の残る角度はシミュレーションの始めに常にゼロであります。
// Make the spring reach shoot for a 70 degree angle. // This could be used to fire off a catapult. hingeJoint.spring.spring = 10; hingeJoint.spring.damper = 3; hingeJoint.spring.targetPosition = 70;
using UnityEngine; using System.Collections; public class ExampleClass : MonoBehaviour { void Example() { hingeJoint.spring.spring = 10; hingeJoint.spring.damper = 3; hingeJoint.spring.targetPosition = 70; } }
import UnityEngine import System.Collections public class ExampleClass(MonoBehaviour): def Example() as void: hingeJoint.spring.spring = 10 hingeJoint.spring.damper = 3 hingeJoint.spring.targetPosition = 70
スプリングを修正することで自動的に有効化されます。