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

边栏推荐
猜你喜欢
随机推荐
Windows10重置MySQL用户密码
[开发杂项][编辑器][代码阅读]ctags&vim
Tencent and NetEase have taken action one after another. What is the metaverse that is so popular that it is out of the circle?
Machine Learning - Processing of Text Labels for Classification Problems (Feature Engineering)
arm learning-1-development board
MNIST handwritten digit recognition - based on Mindspore to quickly build a perceptron to achieve ten categories
MNIST Handwritten Digit Recognition - Image Analysis Method for Binary Classification
LeetCode_Nov_1st_Week
MySQL存储过程学习笔记(基于8.0)
【C语言】数组名是什么
Thunderbolt turns off automatic updates
第二章 STA相关概念
file permission management ugo
树和二叉树
Amazon Cloud Technology Build On-Amazon Neptune's Knowledge Graph-Based Recommendation Model Building Experience
Object.requireNonNull 方法说明
通用解决端口占用问题
Stream API
Introduction to Convolutional Neural Networks
安装pyspider后运行pyspider all后遇到的问题









