当前位置:网站首页>Unity Day03
Unity Day03
2022-08-04 05:32:00 【漫漫有点方】
Day03
今天解决了vs中不会报错以及弹出列表,在
编辑里找到首选项
在右侧修改成自己使用的编译器即可
今天改变:
代码中改变了第一人称与第三人称的视线问题,第一人称可以按自己当前鼠标所改变的视线进行行走。
Vector3 d = transform.TransformPoint(Vector3.left) - transform.position;
character.Move(d * speed * Time.deltaTime);
第三人称相机随人物进行移动,同时第三人称下,人物的面向始终是鼠标方向。
character.Move(Vector3.forward * speed * Time.deltaTime)
第三人称视角
void TCameraRotate()
{
//射线 屏幕上的一个点转换成射线
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
RaycastHit hit;
if(Physics.Raycast(ray,out hit, 100,~(1 << 7)))
{
Debug.DrawLine(ray.origin,hit.point,Color.green);
//四元素
Vector3 v = hit.point - transform.position;
Quaternion q = Quaternion.LookRotation(v);
Vector3 v1 = q.eulerAngles;
v1.x = 0;
transform.eulerAngles = v1;
}
}
修改了刚体,碰撞体。改成了角色控制器。最后发现跳跃被限制。平地摔问题解决,跳跃之后在进行测试。
边栏推荐
- counting cycle
- A code example of the PCL method in the domain of DG (Domain Generalization)
- [Daily Office][Miscellaneous][vscode]tab space
- 第三章 标准单元库(下)
- 第一章 绪论
- Amazon Cloud Technology Build On-Amazon Neptune's Knowledge Graph-Based Recommendation Model Building Experience
- MVC自定义配置
- file permission management ugo
- LeetCode_22_Apr_4th_Week
- 最全的最详细的指针讲解(C语言)
猜你喜欢
随机推荐
JDBC第一学之进行数据库连接时出现The server time zone.....解决办法
MySQL索引
MySQL基础
LeetCode_22_Apr_2nd_Week
理想的生活
Pipe redirection
第一章 绪论
网络通信与Socket编程概述
基于语音识别的QT设计的csgo互动类视频游戏
【五一专属】阿里云ECS大测评#五一专属|向所有热爱分享的“技术劳动者”致敬#
MNIST Handwritten Digit Recognition - Lenet-5's First Commercial Grade Convolutional Neural Network
MVC自定义配置
[开发杂项][VS Code]remote-ssd retry failed
Machine Learning - Processing of Text Labels for Classification Problems (Feature Engineering)
EL表达式
tmux concept and usage
淘宝分布式文件系统存储引擎(一)
跑跑飞弹室外跑步AR游戏代码方案设计
[Development miscellaneous][Debug]debug into kernel
安装Apache服务时出现的几个问题, AH00369,AH00526,AH00072....