第三人称移动
来源:互联网 发布:道衍和尚 知乎 编辑:程序博客网 时间:2024/04/27 19:22
第三人称控制器
public class PlayerVillageMove : MonoBehaviour {
public float velocity=5;
// Use this for initializationvoid Start () {
}
// Update is called once per frame
void Update () {
float h = Input.GetAxis("Horizontal");
float v = Input.GetAxis("Vertical");
Vector3 vel = gameObject.GetComponent<Rigidbody>().velocity;
gameObject.GetComponent<Rigidbody>().velocity=new Vector3(-h*velocity, vel.y, -v*velocity);
if (Mathf.Abs(h)>0.05f||Mathf.Abs(v)>0/05f)
{
transform.rotation= Quaternion.LookRotation(new Vector3(-h, 0, -v));
}
}
}
第一人称角色控制器
private CharacterController controller;
public int =speed=10;
void Statr(){
contoller=this.GetCompontent<CharachercaterController>();
}
void Update(){
controller.SimpleMove(new Vecotr3(Input.GetAcis("Horizontal")*speed,0,Input.GetAcis("Vertical")*speed ));
}
阅读全文
0 0
- 第三人称移动
- Unity3d--第三人称角色移动控制
- Unity3D 第三人称的游戏角色的单选和移动
- 第一人称和第三人称游戏中人物的移动和旋转
- u3d简单的第三人称人物移动与相机跟随
- Unity3d基础(1)角色自动寻路、方向键移动、第三人称相机
- unity 第三人称
- 第三人称控制
- 第三人称控制器
- 第三人称摄像机
- 第三人称摄像机
- 第三人称摄象机系统例子
- 用第三人称写日记减压
- Ogre第三人称摄象机系统
- Ogre第三人称摄象机系统
- Ogre第三人称摄象机系统
- 第三人称相机问题
- Unity第三人称视野
- 折线分割平面
- ReentrantLock分析
- linux shell find 常用用法总结
- 阿里云Ecs绑域名的时候是绑公网IP地址还是内网ip?
- make(3)
- 第三人称移动
- 从HBase数据库表中读取数据动态转为DataFrame格式,方便后续用Spark SQL操作(scala实现)
- 8086汇编:输入输出和数组操作的一些函数
- struts2第十一讲笔记,在页面中使用ognl表达式
- 美化下划线
- C#中调用C++生成的dll出错
- Django cms项目之views.py(3)
- mysql数据库初步学习
- UVa 11572 Unique Snowflakes——思路题