Version: 5.5 (switch to 5.6b)
LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

Method group is Obsolete

JointDrive.mode

Obsolete public JointDriveMode mode;

Description

Whether the drive should attempt to reach position, velocity, both or nothing.

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { 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; } }