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

边栏推荐
- 淘宝分布式文件系统存储引擎(一)
- Rules.make - suitable for viewing in edit mode
- 通用解决端口占用问题
- 网络通信与Socket编程概述
- How to get started with MOOSE platform - an example of how to run the official tutorial
- Fabric v1.1 环境搭建
- Object. RequireNonNull method
- C语言静态变量static的分析
- [English learning][sentence] good sentence
- [Copy Siege Lion Log] Flying Pulp Academy Intensive Learning 7-Day Punch Camp-Study Notes
猜你喜欢
随机推荐
彻底删除MySQL教程
[Development miscellaneous][Debug]debug into kernel
抽象类、内部类和接口
MySQL存储过程学习笔记(基于8.0)
[开发杂项][编辑器][代码阅读]ctags&vim
EL表达式
通用解决端口占用问题
An abstract class, internal classes and interfaces
LeetCode_22_Apr_4th_Week
The second official example analysis of the MOOSE platform - about creating a Kernel and solving the convection-diffusion equation
LeetCode_22_Apr_2nd_Week
counting cycle
[Development Miscellaneous][Editor][Code Reading]ctags & vim
【五一专属】阿里云ECS大测评#五一专属|向所有热爱分享的“技术劳动者”致敬#
LeetCode_Nov_3rd_Week
[English learning][sentence] good sentence
C语言结构体(必须掌握版)
Pipe redirection
Copy Siege Lions "sticky" to AI couplets
2020-03-27









