Unity - 身体物理
生活随笔
收集整理的這篇文章主要介紹了
Unity - 身体物理
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
身體物理是格斗游戲種常見的元素,《生或死》、《街霸》種都有身體物理的身影。本文將展示如何實現
效果:
實現方法:
?
?
?
源碼:附在動點上,動點也是骨骼頂點
using System.Collections; using System.Collections.Generic; using UnityEngine;public class Wobbler : MonoBehaviour {public Transform centerTran;Rigidbody rig;public float hardness;????//可以通過這個值修改乳房搖動幅度private void Start(){rig = GetComponent<Rigidbody>();}private void FixedUpdate(){rig.AddForce(-(transform.position - centerTran.position) * hardness);}}?
資源包:
白膜:
?https://pan.baidu.com/s/1-8dH9VdgGNMy1uaX75j3vw (WASD移動角色)
?
添加身體物理效果的UnityChain小姐姐 ? 如上圖:
?https://pan.baidu.com/s/1Ub7VAqjMkMFcOgF5RiyjQw (請閱讀ReadMe)
總結
以上是生活随笔為你收集整理的Unity - 身体物理的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 手机的一些小秘密,你知道吗
- 下一篇: 无线路由器穿墙能力浅析