当前位置:网站首页>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;
}
}
修改了刚体,碰撞体。改成了角色控制器。最后发现跳跃被限制。平地摔问题解决,跳跃之后在进行测试。
边栏推荐
- [日常办公][杂项][vscode]tab space
- LeetCode_Dec_3rd_Week
- const int * a 与 int * const a 的定义与区别
- win10下mediasoup搭建过程中的一些坑记录
- SFTP的用法
- MNIST handwritten digit recognition, sorted by from two to ten
- 库函数的模拟实现-C语言
- PS像素画学习-1
- Golang environment variable settings (2)--GOMODULE & GOPROXY
- 安装Apache服务时出现的几个问题, AH00369,AH00526,AH00072....
猜你喜欢
Shell基础
集合--LinkedList
IDEA创建Servlet步骤
Tencent and NetEase have taken action one after another. What is the metaverse that is so popular that it is out of the circle?
The second official example analysis of the MOOSE platform - about creating a Kernel and solving the convection-diffusion equation
基于asp.net的法律援助平台的设计与实现(附项目链接)
Shell脚本执行的三种方式
基于语音识别的QT设计的csgo互动类视频游戏
Pytest common plug-in
LeetCode_Dec_1st_Week
随机推荐
LeetCode_22_Apr_4th_Week
指针运算相关面试题详解【C语言】
网络通信与Socket编程概述
Install Minikube Cluster in AWS-EC2
const int * a 与 int * const a 的定义与区别
基于asp.net的法律援助平台的设计与实现(附项目链接)
实现高并发服务器(二)
淘宝分布式文件系统存储引擎(一)
(位操作符)按位与、按位或、按位异或
win10下mediasoup搭建过程中的一些坑记录
MNIST handwritten digit recognition - based on Mindspore to quickly build a perceptron to achieve ten categories
集合---ArrayList的底层
Rules.make - suitable for viewing in edit mode
【独立游戏体验计划】学习记录
LeetCode_Dec_1st_Week
makefile基础学习
[日常办公][杂项][vscode]tab space
target has libraries with conflicting names: libcrypto.a and libssl.a.
虚幻引擎 5 完整指南[2022六月最新课程学习内容]
跑跑飞弹室外跑步AR游戏代码方案设计