当前位置:网站首页>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;
}
}
修改了刚体,碰撞体。改成了角色控制器。最后发现跳跃被限制。平地摔问题解决,跳跃之后在进行测试。

边栏推荐
- 【c语言】整数的二进制表现形式是什么?
- MVC自定义配置
- Brief description of database and common operation guide
- Question 1000: Input two integers a and b, calculate the sum of a+b, this question is multiple sets of test data
- Shell脚本执行的三种方式
- LeetCode_Dec_1st_Week
- file permission management ugo
- 虚幻引擎 5 完整指南[2022六月最新课程学习内容]
- LeetCode_Nov_4th_Week
- jdbc:mysql://localhost:3306/student?serverTimezone=CTT&useUnicode=true&characterEncoding=utf-8时报错
猜你喜欢

The second official example analysis of the MOOSE platform - about creating a Kernel and solving the convection-diffusion equation

淘宝分布式文件系统存储(二)

arm-2-基础阶段

arm学习-1-开发板

Pipe redirection

管道重定向
![虚幻引擎 5 完整指南[2022六月最新课程学习内容]](/img/b3/fe90bca8166108e2e577d5a5e2ea6a.png)
虚幻引擎 5 完整指南[2022六月最新课程学习内容]

MNIST Handwritten Digit Recognition - Building a Perceptron from Zero for Two-Classification

第二章 STA相关概念

【c语言】整数的二进制表现形式是什么?
随机推荐
枚举和联合(自定义类型)-C语言
IEEE802.X协议族
LeetCode_Nov_4th_Week
FAREWARE ADDRESS
位段-C语言
LeetCode_Dec_1st_Week
第一章 绪论
Socket编程详解
MNIST handwritten digit recognition - based on Mindspore to quickly build a perceptron to achieve ten categories
Install Minikube Cluster in AWS-EC2
arm-2-基础阶段
An abstract class, internal classes and interfaces
LeetCode_22_Apr_2nd_Week
C语言对文件的操作(完整版)
counting cycle
JDBC第一学之进行数据库连接时出现The server time zone.....解决办法
Copy Siege Lions "sticky" to AI couplets
树和二叉树
target has libraries with conflicting names: libcrypto.a and libssl.a.
vs2017 redist 下载地址