mode
Whether the drive should attempt to reach position, velocity, both or nothing.
阅读时间1 分钟最后更新于 1 个月前
Definition
- Type: Property
- Namespace: UnityEngine
- Assembly: UnityEngine.PhysicsModule
public JointDriveMode mode { get; set; }
Examples
using UnityEngine;public class Example : MonoBehaviour{ // Create a JointDrive, configure it and assign the JointDrive to // the zDrive element of a configurable joint. void Start() { ConfigurableJoint joint = gameObject.AddComponent<ConfigurableJoint>(); joint.targetPosition = new Vector3(0, 0, -10); JointDrive drive = new JointDrive(); drive.positionSpring = 50; drive.mode = JointDriveMode.Position; joint.zDrive = drive; }}