朱峰社區(qū)首頁(yè) 朱峰社區(qū)

搜索資源 注冊(cè)|登陸

等待

返回 展開菜單
按功能 按軟件

Unity3D游戲制作教程

Unity3D游戲制作教程

包含5節(jié)視頻教程

本系列包含Unity3D介紹、Unity3D導(dǎo)出人物、Unity3D導(dǎo)出場(chǎng)景、Unity3D導(dǎo)出動(dòng)作、游戲測(cè)試最終完成一個(gè)簡(jiǎn)單的游戲。是一套非常完整的Unity3D游戲制作教程。

關(guān)閉

Unity組件:Fixed Joint 固定關(guān)節(jié)

關(guān)注:3185 留言:0 樓主:深圳七彩鹿科技有限公司 發(fā)帖時(shí)間:15年11月16日

深圳七彩鹿科技有限公司

普通會(huì)員

深圳七彩鹿科技有限公司

社區(qū)新人:1級(jí)

關(guān)注2691人

  • 積分

    1

  • 登陸

    1

  • 發(fā)帖

    1

  • 作品

    1

間隔線

Fixed Joints restricts an object's movement to be dependent upon another object. This is somewhat similar to Parenting but is implemented through physics rather than Transform hierarchy. The best scenarios for using them are when you have objects that you want to easily break apart from each other, or connect two object's movement without parenting.

固定關(guān)節(jié)基于另一個(gè)物體來(lái)限制一個(gè)物體的運(yùn)動(dòng)。效果類似于父子關(guān)系,但是不是通過(guò)層級(jí)變換,而是通過(guò)物理實(shí)現(xiàn)的。使用它的最佳情境是當(dāng)你有一些想要輕易分開的物體,或想讓兩個(gè)沒(méi)有父子關(guān)系的物體一起運(yùn)動(dòng)。


The Fixed Joint Inspector 固定關(guān)節(jié)檢視面板。

Properties 屬性
  • Connected Body 連接的剛體
    Optional reference to the Rigidbody that the joint is dependent upon. If not set, the joint connects to the world.
    連接的剛體。一個(gè)關(guān)節(jié)連接的剛體引用,可選。如果沒(méi)有設(shè)置,那么關(guān)節(jié)將和世界相連。
  • Break Force 斷開力
    The force that needs to be applied for this joint to break.
    斷裂的力。破壞關(guān)節(jié)的力的大小。
  • Break Torque 斷開扭矩
    The torque that needs to be applied for this joint to break.
    斷裂的扭矩。破壞關(guān)節(jié)的扭力的大小。
Details 細(xì)節(jié)

There may be scenarios in your game where you want objects to stick together permanently or temporarily. Fixed Joints may be a good Component to use for these scenarios, since you will not have to script a change in your object's hierarchy to achieve the desired effect. The trade-off is that you must use Rigidbodies for any objects that use a Fixed Joint.

在游戲中肯定存在這樣的情境,你想要物體永久或暫時(shí)的粘在一起。固定關(guān)節(jié)就是一個(gè)適用于這類情況的組件,它不需要用腳本來(lái)改變你的物體的層級(jí)來(lái)實(shí)現(xiàn)目標(biāo)效果。但僅適用含有剛體的物體。

For example, if you want to use a "sticky grenade", you can write a script that will detect collision with another Rigidbody (like an enemy), and then create a Fixed Joint that will attach itself to that Rigidbody. Then as the enemy moves around, the joint will keep the grenade stuck to them.

例如,你想搞個(gè)粘性炸彈,你就可以寫個(gè)腳本來(lái)檢測(cè)物體與其他剛體(比如敵人)的碰撞,然后創(chuàng)建一個(gè)固定關(guān)節(jié)將自身與該剛體相連。那么當(dāng)敵人移動(dòng)時(shí),關(guān)節(jié)就會(huì)使導(dǎo)彈一直粘在他身上。

Breaking joints 斷開關(guān)節(jié)

You can use the Break Force and Break Torque properties to set limits for the joint's strength. If these are less than infinity, and a force/torque greater than these limits are applied to the object, its Fixed Joint will be destroyed and will no longer be confined by its restraints.

你可以使用破壞力與破壞扭力屬性來(lái)設(shè)置關(guān)節(jié)強(qiáng)度的極限。如果這些參數(shù)小于無(wú)窮大,而施加到物體上的力或力矩大于這個(gè)限制,那么固定關(guān)節(jié)將被銷毀,它對(duì)物體的約束也就不存在了。

Hints 提示
  • You do not need to assign a Connected Body to your joint for it to work.
    關(guān)節(jié)并不需要設(shè)置一個(gè)連接的剛體。
  • Fixed Joints require a Rigidbody.
    使用固定關(guān)節(jié)自身要有個(gè)剛體組件。

贊0 踩0

未知用戶

2005-2025 朱峰社區(qū) 版權(quán)所有 遼ICP備2021001865號(hào)-1
2005-2025 ZhuFeng Community All Rights Reserved

VIP

朱峰社區(qū)微信公眾號(hào)

回頂部

1.復(fù)制文本發(fā)給您的QQ好友或群、微信等;好友點(diǎn)擊鏈接以后,轉(zhuǎn)發(fā)就成功了。 2.如朋友點(diǎn)擊您的鏈接,您需要需刷新一下才行;同一個(gè)好友僅能點(diǎn)擊一次。
購(gòu)買VIP,觀看所有收費(fèi)教程!