当前位置:网站首页>Unity Day01
Unity Day01
2022-08-04 05:32:00 【漫漫有点方】
Day01
首先进行实践了u3d中使一个模型进行前后左右移动,例如:
//前
if (Input.GetKey(KeyCode.W))
{
gameObject.transform.position += Vector3.forward * speed * Time.deltaTime;
}
Input.GetKey输入.KeyCode枚举.W按键。
gameObject某一游戏对象.transform改变x,y,z的位置。
.forward即方向,相同的还有back(后),right(右),left(左)。
Time.deltaTime即由于不同的电脑配置导致的帧数有区别,用于使结果平滑。(每秒除多少帧数的一个小数)。
简陋的界面:(人物模型unity商城)
开始移动时:
之后设置了碰撞体与刚体:
下一步试试跳跃,加速功能,我现在使用的是unity2021.3,想进行汉化,还有一个问题就是编写vs代码时,例如编写gameObject.transform.position时,没有弹出列表。、
继续加油。
边栏推荐
猜你喜欢
随机推荐
Amazon Cloud Technology Build On-Amazon Neptune's Knowledge Graph-Based Recommendation Model Building Experience
Question 1000: Input two integers a and b, calculate the sum of a+b, this question is multiple sets of test data
Detailed steps to install MySQL
MySQL索引
Tencent and NetEase have taken action one after another. What is the metaverse that is so popular that it is out of the circle?
MySQL批量修改时间字段
How to get started with MOOSE platform - an example of how to run the official tutorial
Thunderbolt turns off automatic updates
vim的介绍
LeetCode_Dec_3rd_Week
LeetCode_Nov_3rd_Week
Usage of SFTP
枚举和联合(自定义类型)-C语言
抽象类、内部类和接口
C语言结构体(必须掌握版)
IEEE802.X协议族
arm learning-1-development board
(位操作符)按位与、按位或、按位异或
Copy Siege Lions "sticky" to AI couplets
题目1000:输入两个整数a和b,计算a+b的和,此题是多组测试数据