Version: 2023.1
Removed

Component.rigidbody

切换到手册
Obsolete public Component rigidbody ;

描述

附加到此 GameObjectRigidbody。(如果未附加,则为 null)。

using UnityEngine;

public class Example : MonoBehaviour { void Start() { GetComponent<Rigidbody>().AddForce(1, 1, 1); } }