unity基础开发----物体位移和旋转实用代码
2013-11-21 22:46
531 查看
using UnityEngine; using System.Collections; public class text : MonoBehaviour { public GameObject MoveGameObject; // public Vector3 Terget; public Transform Terget; public float speed=10; // Use this for initialization void Start () { } // Update is called once per frame void Update () { // MoveGameObject.transform.position=Vector3.MoveTowards(transform.position,Terget,0.005f); MoveGameObject.transform.rotation = Quaternion.RotateTowards(transform.rotation, Terget.rotation,Time.deltaTime*speed); } }
相关文章推荐
- 如何使用MSBuild Community Tasks
- Unity+4.x+Game+AI+programming CookBook 杂记
- ahjesus Unity3D XML注释被编译的问题
- unity3d 中文教程教你unity3d 的替换效果
- 可以快速保存、访问和粘贴文本片段的Unity漂亮工具
- 可以快速保存、访问和粘贴文本片段的Unity漂亮工具
- [Unity3d]socket通信 切换到web版本时报错SecurityException解决办法
- [Unity3d]unity同时开启多个项目
- [Unity3d]unity同时开启多个项目
- Unity3D占用内存太大的解决方法
- Unity3D 4.3新特性 —— 2D
- Unity3D 4.3新特性 —— 动画
- Unity3D设置字体颜色大小,用于游戏分数显示设置等,
- unity3d ios android pc path
- 转载 教你使用PS来制作unity3D随机地形
- Unity3d 绘制摇曳的草丛 sway in the breeze, add Grass Texture, add Detail Meshes
- Android Unity3D游戏开发之躲避方块(附源码)
- ngui pack字体在unity3d4.x显示问题
- Unity3D学习笔记——让Cube沿着某个轴运动
- Unity3D学习笔记——Camera绕着物体旋转