JointDrive.maximumForce 最大力

var maximumForce : float

Description描述

Amount of force applied to push the object toward the defined direction.

应用推动物体朝向定义方向的力的大小。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	void Start() {
		ConfigurableJoint joint = gameObject.AddComponent<ConfigurableJoint>();
		joint.targetPosition = new Vector3(0, 0, -10);
		JointDrive drive = new JointDrive();
		drive.mode = JointDriveMode.Velocity;
		drive.maximumForce = Mathf.Infinity;
		joint.zDrive = drive;
	}
}
// Create a JointDrive, configure it and assign the JointDrive to
// the zDrive element of a configurable joint.
//创建一个关节驱动,配置它并指定关节驱动到一个可配置关节的zDrive元素

function Start() {
	var joint : ConfigurableJoint = gameObject.AddComponent(ConfigurableJoint);
	joint.targetPosition = Vector3(0,0,-10);

	var drive : JointDrive = JointDrive();
	drive.mode = JointDriveMode.Velocity;
	drive.maximumForce = Mathf.Infinity;

	joint.zDrive = drive;
}
最后修改:2011年1月27日 Thursday 21:37

本脚本参考基于Unity 3.4.1f5

英文部分版权属©Unity公司所有,中文部分© Unity圣典 版权所有,未经许可,严禁转载 。