大家好 欢迎来到我频道的新系列教程 Hello, and welcome to a new tutorial series here on my channel.
而这个严肃的 我会为你创造一个第三人称控制器 And this serious, I will create a third person controller of you.
你们已经在我的频道上看到了我几天前发布的一些视频 You have seen on my channel some videos that I have posted some days before.
在那个视频中 你看到了自我行动或瞄准 对我来说 On that videos, you see the self action or the aiming. And for me,
是第一个问题 Of was the first question.
我是使用acid存储中的资产 还是自己创建资产 Will I using assets from the acid store, or will I creating, all by myself?
这个问题的答案很简单 So that question, I can really easy answer for me.
我会用酸液店的酸 I will use acids from the acid store.
嗯 我有一份主要的工作 有时我一周工作七天 Um, I have a main job, I sometimes I am working seven days in a week.
干了八个小时的主要工作 For eight hours in my main job.
所以我没有那么多的空闲时间来工作 是什么创造了所有这些努力自己 So I have no so much free time to work, what creating all this effort by myself.
其次 我没有学校要创造 也没有自己的资产 And the next is, I have not the school to create or as a asset by myself.
你看这里 You see here that.
模型 因为它来自MM Model, as it is from the MM.
多边形 末日启示 还有酸液店Zinti的包 Polygon, apocalyptic, um, pack from Zinti from the acid store.
所以 我可以告诉你 我没有能力在blender中创建这个东西 哦 做一个 So, and I can tell you I have not skill to create this guy in blender, oh, and make a.
是啊 让开 刷漆 麦垛就变成了天空 Yeah, make a way, painting, and the ricking was the sky.
我没时间学这个 所以 Um, and I have not the time to learn to do this, so.
这是第一个 是的 That is the first, and yeah,
其次 我没有那么多的编码裙 看到陷阱 The next is, I have not so many coding skirts, and see trap.
这样我就可以自己写了 So I can write it all, um, yeah, by myself.
使用Playmate 可以玩 make是一个很好的工具 And for that are using Playmate, can play, make is a really great tool.
嗯 你可以在酸店买到它 每次大概50美元 Um, you can buy it in an acid store that costs at a moment, I think fifty dollars.
所以你以后可以用印章购买 变成半价 所以你可以购买并再次申领 So you can buy it later in a seal, became that for the half price, so you can buy and claim again.
或者是二十五美元我们在苏特年用的 Or twenty five dollars the next what we are using here in the Sutor year.
这段视频来自O-T 摄像机控制器 This video is from O-T, the camera controller.
我们可以在我的项目中看到 飞机在这里 And we can see here in my project, to, does the plane make here.
这是我的相机 你可以看到这里的OD相机控制器 也就是你用的 或者是甜点人相机 And here's my camera, and you see here the OD camera controller, that is, what are you using, or dessert person camera.
我必须说 因为它是最好的相机控制 ROMDay是它的风暴 And I must say, as it is the best camera control there, ROM Day is its storm.
你只会找到更好的内容 并带来游戏所需的所有选项 You find nothing but better and bring all the option, what you needed for your game.
问一下木头和摇滚控制员 为什么它这么好所以 Uh, ask that you from the wood and rock controller, and why is it so good So.
你有在这里 You have here.
你可以创造新的马达 CS 这是马达 你可以创造 The motors, you can create new motors. CS, this are motors, what you are can creating.
真的 真的很酷 这对于一个组织者来说非常有效 Really, really cool, and this works very good of a playmaker.
我们有一些设置 看看我们能做什么 And we have some setting, see what we can.
把它设置好 我们在这里寻找我的目标 但是安排 我们有偏移 这真的很酷 Set it up and we are looking here for my aiming, but arrange, we have the offset. This is really cool.
是的 我们可以一天画画的速度 这对我来说是最好的 And yeah, we can day to draw draw speed. That is, yeah, for me the best.
一个摄像头控制着陆 存储 A camera control lands, store.
目前的价格是30美元 At the moment cost thirty.
1美元 但是我们可以在打折的时候花50美元买到 Dollar, but um we can get it buying in a sale for fifty.
50美元 非常非常好 好的 让我们开始吧 Dollar don for fifty bucks, that's very, very good. OK, so, but let's start.
让我们从控制器开始 所以我有 Let's starting with the yeah, controller here, with the main basic. So I have, um.
思考如何创造它 我想我们会的 Thinking how we can create it. And I think we will.
为我们创造一些商品 Create some some goods for us.
在这个视频中 我们的目标是 在天空中行走 下一个视频是我们边跑边蹲下 So in this video's goal is, we will are walking with the sky. Next video is we were running and crouching with the sky.
一会儿 美国 我们将创造一个冷却的空中攻击 And on a second, the U-S, we will create a stave, a cool attack down of the sky.
所以我知道了 我希望我能每周带一段视频 So and I see, um, I hope I can bring every week a video.
去Youtube上看看 这样你就能看到了 To you what to Youtube, so you can see it.
学习它 所以当你有问题的时候 你可以把你的问题写在视频下面 或者你来参加讨论 Learn it, so when you have questions, you can write your questions under the videos, or you come on the discussion.
我暂停了来自discard Playmaker和order字符控制器的链接 在描述 I paused the link from the discard and from Playmaker and from the orde character controller. In the description.
所以 嗯 当你有问题的时候可以来问我 So um, yeah, come on a discord to can question me when you are have problems.
这里的设施 我们的工作 所以 但让我们开始 Of the setting up here, what we are doing. So. But let's start.
嗯 啊 Um, ah.
我忘记了 在我们开始之前 我们在这里用来移动的 对于一个人 控制器 你有三种方式来移动 I forget that before we start, what we are using here to moving, for a person, controller, you have three ways to move.
你的角色 首先是使用角色控制器 在这 Your character, the first is using, um, a character controller. In this.
因为它是组件单元 组件 这就是我们所使用的 As it is the component unit, component, that is what we are using for our.
这里是控制器 下一个是 你可以在你的物理控制水平上移动 Controller here, the next is, you can move in Your control level of physics.
但在这方面 我看到了其他游戏 我自己测试 嗯 你可以 But on that, I have something like seeing other games, and I'm testing for myself. Um, you can getting.
相机抖动 抖动 Jittering camera, jittering.
嗯 So um.
当你的帧数下降时 你就会感到不安 或者当你的游戏 When you have frame drops, then you can get jittering, or when your game.
我在下面工作 I am working on lower.
他看到了 是的 修复它更新不是解决方案 He sees, and yeah, a fix it update is not the solution.
对我来说 什么 是吗 什么 它会变得更好 For me, what? Yeah? What? It will make better.
这就是为什么我不使用佝偻病的身体 That is why I not use a ricket body.
或者用身体控制器 Or with a body controller.
是的 但我必须说 我的控制器 我们没有 Yeah, but I must say, my controller. We have no.
攀登 我们没有跳跃 是的 那么移动a的下一种方法 Climbing, we have no jumping. Yeah. So the next way to move a.
玩家模式是 你可以使用粗鲁的动作 Player model is, you can use rude motions.
也就是你在轴上移动的时候 That are any mentions that you are moving on the axis.
问题是 And um, the problem is.
第一个问题是 在创建控制器时只能使用根运动 我们有问题 而且可以 The first problem is, you can only use root motions when you are creating a controller. We have a problem and can.
只做粗鲁的动作 但第一个和第二个问题是 你得到的是速度 Only use rude motions. But the first and the second problem is, what you have is speed.
所以我的控制器就是从速度上比控制器快两倍 带着粗鲁的动作 So my controller is from the speed are double faster as controller, with rude motions.
但它看起来很自然 我在一个视频里看到过 所以是的 But it looks natural, I see it in a video, so yeah,
这就是为什么我不使用根运动 不使用火箭体 而是使用简单的直肠控制器 That is why I use no root motions, no rocket body, be using simple rectal controller.
一开始 我们在吃 So at first, we were eating a.
空游戏对象 高利贷 零点 Empty game object, the uresit, the zero point.
我把这个家伙 这个模型放在这个物体下面 因为害怕创造 把它叫做玩家 And I put here this guy, this model under this, the object, for fear of creating, and to call it player.
这里我有一个player 当你没有player时 我有 So I have here player, when you have not player going here, I have.
设置好 这是我的播放器 这是下一层 我的意思是 相机 Set it up, analia, oh, here is my player, and I have the next layer, mean, camera.
打出来就行了 在那里 是的 改变它 Type it and that's all, yeah. There. Yes. Change it.
联合国的攻击玩家 它在 And UN attack player. It's on.
主要镜头年份为这一层 的意思是 摄像头 好吗 Came on the main camera year for the layer. Mean, camera, okay?
所以第一个是 我认为这是一个很好的开始 我们的相机里有你 我有75 So the first is, I think is a good start to change, our camera built of you, I have 75.
这里是0 01 I have here 0.01.
你的游戏 你的游戏带来了什么 What a clipping planes and a viewpoint is what your game, what your game bring.
当你有一个开阔的世界 你需要 紧 When you have a big open world, you need, um, tight, um.
你的球员能看多久 Oh, how long your player can look in.
所有的 All that are.
我想我现在已经找到了 Thousand units and only much, I think I've found that at the moment.
但是我们可以以后再改 But we can change it later.
现在我们需要一个组件 So and now we need here a component that is.
这是美国的控制 但我从O-T跟你谈过 American control as it is, but I have talking to you from O-T.
所以我们这里需要的 输入源是我们正在进行的 播放器创建空的 我们称之为 So we need here, the input source was that we going on, the player create empty, and we call it, um,
进口的东西 所以 这 Import stuff. So. And this.
或者在这个游戏对象下 我们稍后会从玩家和库存中带来UI Or under this game object, we will bring later the UI from the player and the inventory.
现在我们在这个下面创建另一个游戏对象 我们叫它 So now we create another game object under this, and we call it.
进口 来源和带来这里 Imports, source and bring here.
输入 统一 输入源 Input, unity, input source.
这很简单 这是我们主摄像机的一个组件 So that is really easy. That is a component for our main camera.
首先 启用 这是输入和邪恶 这里说没有 So at first, um, enable, this is the input and evil, and here say none.
这将告诉查看激活器是当你旋转时 相机 只有当你拿着左鼠标或握着左鼠标 右嘴 This will tell the viewing activator is when you are rotated, camera, only when you are taking left mouse or holding left mouse, right mouth.
中间 鼠标或左 右 但是我们说 不 我们会每次旋转相机 And the middle, mouse or left and right, so but we say, no, we will every time rotate the camera.
现在我们有 你找到 找到输入的力 So now we have, say, you find, find your input force.
是更新 没事的 然后我们使用锚点 也就是玩家所说的1 8 Ah, was update, it's okay. Then we use the anchor, that is the player to say 1.8.
我们继续前进 创建第一个 And we going here advanced and we create our first.
摄像机马达 这将是第三个人修理它 Emra马达在这里 Um, camera motor, this will be a third person fix that. Emra motor is here.
你可以看到 And you can see.
搜索人员 修好它 好吗 这是这个名字 Search person, fix it, okay? That's the name.
所以用RickAnchor 用我们的球员 没错 污染是可行的 没错 So use Rick Anchor, use our player, that's right. Pollution is enabled, that's right.
Feed和ebridge 对 对 不是这样的设置 Feed and ebridge, yeah, yeah, not so that settings, okay?
距离 指向五 平滑是零 Distance, point to five. Smoothing makes zero.
碰撞是可以的 缩放 我们使它适合 Collision is okay, zooming, we make it out and fit.
好了 让我们看一下 我们在这里 So it it's OK, so let's see to be up, we make it here.
在这一点上 我们做了一个邪恶的 所以你不能 你不能 移动的相机 On this, we make an evil, so you are not unable, that you cannot, moving the camera.
让我们来看看 Let's see.
我可以在天空中旋转摄像机 I can rotate the camera around the sky, okay?
好 让我们从组织核心开始 点击 祈祷 第一个FSM OK, so let's start here with Playmaker, right? Click, pray, the first FSM.
现在我们说 玩家按 And now we said, player press.
在这里 左边 控制 按住它 然后左键点击你创建的这个来完成 Make it here, left, control, hold it and left click on this You create to finish.
在状态 当第一帧开始时你的游戏就开始了 At state, and so when the first frame start your game start, he going.
选择状态 然后在这里 我们在这里首先寻找setgameobject Chooses state and going here in this, and we're looking here for set game object out of first.
所以我有勇气面对全球玩家 所以让我看看我们是否能一起做到 So I have courage before a global player, so let me see if we make it make it together.
走吧 你玩制造商 Be going. You play maker.
全局变量 我 The global variables here. I.
是的 我都删了 我们一起去吧 Yes, I deleted all, so we will make it together.
还有这个 你什么时候看到你的全球 And this, when do you see your global.
所以 一开始我们把它放在这里 这是玩家 每一个火焰和新的全球可穿戴设备 So, uh, at first we put it here, that is the player, every flame and new global wearable and call it.
玩家 看这里 玩家 好吧 下是托尼 Player, see here, player. Okay. Tony next is.
找到对象了 Find came object.
对象名 我改一下主摄像机名是这个 The object name, let me change my main camera name is this.
trueC为拷贝控制 B为导入 viftec主摄像头和全局 新全局 可穿戴装饰 On true C for copy control, B for import, viftec main camera and globals, new global, wearable decorating.
回答好吗 Answer it OK?
我们首先要做的是 将这个游戏对象设置为一个全局变量 比如玩家 So what we are doing at first, we have setting this game object as a global variable, like player.
接下来 我们要对主摄像机说 驯服卡马拉 把我们储存起来 主卡马拉 And as the next, we have say to the main camera here, with taming Kamara and stores us, main kamara.
我们也可以做同样的事 And we can do the same this, um,
这个媒体 就像在主 镜头 人们看着领导人 下一个是 This press, like in the main, camera, people looking leader. So the next is.
我们需要的是一场精彩的演讲 What we are need is a get excess lecture.
所以 So.
或者你是否能够与他人取得联系是你与玩家输入系统之间的桥梁 从键盘上 Or do you get access back to others is the bridge from the import system from your player. So from the keyboard.
对于我们的游戏 M 你看这里我们有两个通道 水平通道和垂直轴 让我看看 To our game, M, you see here we have two access, horizontal access and vertical axis. So let me see.
在项目设置中 这里有输入管理器 输入管理器告诉 On the project settings, we have here input manager and the input manager tell.
你看你的横轴 看你的横轴 横轴是左右 You your horizontal axis and see your axis, horizontal axis is left and right.
左边和右边是你键盘上的航空键 是的 或者 Left and right is the aero keys on your keyboard, yeah, or.
A和D 好吧 当你说你会的时候 你必须把它删除 你 The A and D, OK, when you are saying you will, using later the aerochies for our, you must delete it. You.
相同的垂直向上和向下箭头 The same for the vertica up and down Arrow.
向前和向后都在附近或这里 就像 我们好了 Or forward and backward was near or here. As in, we okay.
所以这 So this.
UM 来自这个轴的输入 UM, input from this axis.
你之前会乘以它 这是一个很好的解决方案 我们在这里说 You will multiply it before. That is a good solution. So and we say here.
相对 输入 The relative, the input.
相对于我们的主摄像机和主摄像机 这就是我们的球员 A relative to our main camera and main camera. Is that what follow our player.
相对于我们 所以在一个新的全球性的 可穿戴的手臂上恢复这个 Relative to us, so restore this in a new global, wearable arms.
玩家向量 这里也是一样 调用者作为输入 Player vector, and we do the same here, and callers as input.
大小 好吧 我们看看 它会做什么 Magnitude. Okay. So let's see, what will the do.
现在 它是0 当我按键盘这里时 这里是输入幅度 我按前进 So you see, at the moment, it's zero, so when I press here on my keyboard, you see here the import magnitude, I press forward.
它的贫穷 和看到这里 It's poor, and to see here.
好了 当我按下 前进 键时 你看 我旋转相机 看到了这个 Okay, so, and when I press forward and I, you see, um, I rotate my camera and see this.
好机会 我们的胜利者 好吗 Good change, our victor, OK?
接下来 我们创造了一个新的效率 At next, we creating a new eficent.
因为这是 And because this is.
Fms Fms,
看看这个 想要一个光滑的蝴蝶结 Look at going in this, looking for a smooth bow.
平稳 看这里的方向 这是下一个 目标方向是我们的玩家Victor Smooth, look at direction here, this is the next, the target direction is our player Victor.
那就是我们不需要说的话 八句话 That is what we are not need and say, eight the speech.
老样子就八了 好了 现在就走完了 Old look will be eight, OK, now finish lead up to the.
我们来看看 So let's see on.
它会做什么 当我按下 你看到 这个人看着 What will it do So when I press as you see, the guy look.
的 The.
你看对方向了 You look in the right direction.
好了 够了 Okay, that is it.
所以 嗯 现在我们将创建一个字符控制 因为这是我们所需要的 So, um, now we will create a character control, as it is what we are needing.
或 Or.
我们的A运动系统 让我看看 我们有相同的 Our A movement system. So let me see here that we have the same.
就像我的游戏一样 45 As in my game. Forty five.
这就是皮肤的白色 这没什么 但你需要 So that is the skin white. That is nothing, but you need.
设为0 0001分钟 移动 距离可以吗 Make it 0.0001, okay minutes, move, distance is OK?
九 五 是发件人 看到了吗 你可以改变它的高度 Nine, five, it's the sender. Do you see here you can change the high of it.
比如说 还有无线电 Let's say, and radios.
橙色 三 五 高1 88 Orange, three, five and a high 1.88.
这是一样的 就是这样 That's the same, so that's it.
我把它保存了 所以在下一次我们创建一个平面时 把它设为ear重置 Um, I save it, so at the next we create a plane, so make it ear resetting.
没关系 使这里五十 That's okay. Make here fifty.
五十岁左右 但我们现在有个问题 And fifty so, but we have at a moment a problem.
土地 Land.
角色控制器会看到它和和和没有重力 Character controller will see it and and and have no gravity as here.
是在空气中 不是 Is in the air. Is not.
对 不是在底部 或者我们可以读一个新的FSM Yeah, not on the bottom, or we can do it read a new FSM.
L 或重力 L, or gravity.
所以 So.
它在这里 让我看看 所以 It's going here, and let me see here. So.
起初 At first,
你让水果变得抽象 你看这里我有create You make fruits abstract, and you see here I have create.
在这个重力下反抗新的反抗者 这是全球性的 Rebel new rebels at this gravity. That is the global.
是的 我们在这里看到了抽象的Z Yeah, and we see Z abstract here.
每秒9 81 你看 在这个 9.81 every second, so you see, um, in this.
在布景里 我在找他的油 它是怎样 In the settings, I'm looking for his oil. How is it.
物理 你看 这是 Physics here, you see. That is.
重力是9 81 当你有另一个 The gravity from unity as the 9.81. When you have here the other.
韦斯特 你必须把它带过来 Um, value, you must bring it here.
是的 但我们没什么零钱 可以做个水果夹 Yeah, so, but we have nothing change and make a fruit clamp.
在那之后 After that,
重力在这里 负8 最大值是20 The gravity is here, minus eight and a max is twenty.
所有的都说了 这和我说的是一样的 让我们看看 And said everything, so that is the same what I have, so let us see.
把它 开始 Bring it up. Start.
你看 他在空中 And you see, he is in the air.
为什么我们需要水 需要运动 So why why we need a water, a movement.
哦 Uh,
马达 这就是我们需要的 我们可以利用重力 Motor, that is what we need to. We can use the gravity.
以此类推 我们把它移到这里 和我这里用的一样 And so on that we move it up here. So the same what I using here.
哦 Uh,
歌手 Singer.
首先 我把胜利者 玩家 胜利者是团队 我们在这里做什么 So at first, I take the victor, the player, victor was the team, what we are doing here.
所以 我们需要回到我们的 So, and we need here to get back to our.
为了这个 我们带上我们的球员维克多 So and for this, we take our player Victor.
在这里 我们称新语言为X 称新语言为 And for here we calling new verbal the X and new verbal for the.
Z不是全局的 Z, that are no global.
受欢迎的 让我们看看接下来的tavier 接下来你将会设置我们的向量 Welcome. So let me see what Taviers next, as next you will set our vector.
这里和这个 我们称之为新的语言访问 Here and for this, we calling a new verbal access.
讲座吗 好吧 Lecture? Okay?
这里我们从这里给出X值 从这里设置值 这里我们使用重力 So here we give the X value from here, and set value from here, and here we, using our gravity.
我们在这里创造的 所以每一个坐标系 我把它放在这里 静止并相乘 What we are creating here. So every frame, so then I have put it here, clam and multiply.
所以 So.
维克多爬大小 Victor Climb magnitude.
所以过剩的选举 So the excess electoral.
现在 我们说4 接下来 我要做的是乘法 At the moment, we say four, and for the next, what I have here is the multiply.
你也一样 我想 因为 You're the same excess, and I think, for.
为了测试 是的 我们需要一个控制器 移到这里 For the moment for testing. Yeah. And we need a controller, move here.
移动到此处的按钮以访问矢量 第二个 Move to the button here to access a vector. A second.
没关系 我在这里创建了一个小立方体或者测试 哦 让我们开始吧 That's okay, I have creating here a little cube or testing, oh, and let's start.
就像之前一样 So and just see before.
所以现在是速度 嗯 是的 So at the moment is the speed, um, yeah,
非常快 但是在下个视频中 当我们 Very fast, but in the next video, when we are.
将动画加入其中 行走和空闲 在下个视频中 Bringing the animations in it, walking and idle. In the next video.
所以我认为它看起来好一点 然后我们可以从蚌和速度来改变值 So I think it looks a little better, and then we can change the value from the clam and from the speed.
现在我们有了 What for Now we have here.
我们的第一个控制器可以移动吗 Our first controller and can moving around with it?
这是一个基本恒星 That is a basic star.
创建它是一个人控制器 Creating it's a person controller.
我这边给你个小建议 少说几句 就像我们一样 And a little tip from my side here, make an omits, be us.
但是到零 所以你看到的阴影看起来好多了当你听到这个的时候 不太好 Yet to zero, so you see the shadow looked much better as when you have hear this, not too.
就这些了 我希望这能帮到你们 当你们有问题的时候 可以给我写信 或者在视频下面 So that's it, I hope that help you when you have questions, write me on the discord or under the video.
感谢收看本期视频 请订阅我的频道 我们下次再见 再见 Thank you for watching the video, please subscribe me, and yeah, see you next time. Bye bye.
歌手 Singer.