百花楼论坛全国_一品楼QM论坛_泻火吧论坛重庆

  • 您的位置:首页 > 新闻动态 > Unity3D

    unity3d给物体增加扭矩力

    2019/4/9??????点击:
    using UnityEngine;
    using System.Collections;
    
    public class AddTorqueExample : MonoBehaviour
    {
        public float amount = 50f;
        
        
        void FixedUpdate ()
        {
            float h = Input.GetAxis("Horizontal") * amount * Time.deltaTime;
            float v = Input.GetAxis("Vertical") * amount * Time.deltaTime;
            
            rigidbody.AddTorque(transform.up * h);
            rigidbody.AddTorque(transform.right * v);
        }
    }
    主站蜘蛛池模板: 隆化县| 正镶白旗| 福海县| 通江县| 高阳县| 邵东县| 灯塔市| 齐河县| 深州市| 淮安市| 伊宁县| 吴桥县| 梁平县| 镇赉县| 尉犁县| 北川| 芷江| 广平县| 化德县| 德兴市| 望都县| 鱼台县| 九龙坡区| 丘北县| 察隅县| 清流县| 新乐市| 平和县| 尖扎县| 河源市| 馆陶县| 吴旗县| 遵义市| 梅河口市| 来宾市| 湄潭县| 确山县| 金坛市| 吴堡县| 彰化市| 临沂市|