Joint2D.attachedRigidbody

Switch to Manual
public Rigidbody2D attachedRigidbody ;

Description

附加到 Joint2DRigidbody2D

Joint2D 会自动附加到与 Joint2D 处于相同 GameObject 上的 Rigidbody2D

另请参阅:Rigidbody2D


using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { public Vector2 force = Vector2.up;

void Start() { // Apply a force to the rigidbody attached to the joint. GetComponent<Joint2D>().attachedRigidbody.AddForce(force); } }