找回密碼
 注冊帳號

掃一掃,訪問微社區

collider.attachedrigidbody 附加剛體

2015-1-4 16:27| 發布者: 楊炎| 查看: 2203| 評論: 0|原作者: 蠻牛|來自: unity3d腳本manual

摘要: collider.attachedrigidbody 附加剛體varattachedrigidbody: rigidbodydescription描述the rigidbody the collider is attached to.碰撞器附加的剛體。returns null if the collider is attached to no rigidbody.如 ...

collider.attachedrigidbody 附加剛體

varattachedrigidbody: rigidbody

description描述

the rigidbody the collider is attached to.

碰撞器附加的剛體。

returns null if the collider is attached to no rigidbody.

如果碰撞器沒有附加剛體返回null。

colliders are automatically connected to the rigidbody attached to the same game object or attached to any parent game object.

碰撞器被自動連接到剛體,剛體附加在相同游戲物體或附加在父游戲物體。

c#

javascript

using unityengine;

using system.collections;

public class example :monobehaviour{

public void awake() {

collider.attachedrigidbody.addforce(0, 100, 0);

}

}

// lift the rigidbody attached to the collider.

//升起附加在碰撞器的剛體

collider.attachedrigidbody.addforce(0,100,0);

相關閱讀

文章點評
相關文章
女校游泳队彩金