Joint.connectedBody 连接刚体

var connectedBody : Rigidbody

Description描述

A reference to another rigidbody this joint connects to.

这个关节连接到的另一个刚体的引用。

If not set, the joint connects the object to the world.

如果不设置,这个关节将连接物体到世界。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	public Rigidbody otherBody;
	public void Awake() {
		hingeJoint.connectedBody = null;
		hingeJoint.connectedBody = otherBody;
	}
}
// Connects the joint to the world instead of another rigidbody
//连接这个关节到世界而不是另一个刚体
hingeJoint.connectedBody = null;

// Connects the joint to another body
//连接这个关节到另一个刚体
var otherBody : Rigidbody;
hingeJoint.connectedBody = otherBody;
Page last updated: 2011-1-26