CharacterController 中Move 和 SimpleMove的区别分析

 

  • CollisionFlags Move(Vector3 motion);

Descriptionapp

A more complex move function taking absolute movement deltas;ide

Attempts to move the controller by mothon will only be constrained by collisions.It will slide along colliders. CollisionFlags is the summary of collisions that occurred during the Move.This function does not apply any gravity.函数

角色移动只受到碰撞约束。角色遇到碰撞时将会沿着碰撞盒滑动,返回值是移动过程当中遇到的碰撞信息的汇总(CollisionFlags),Move函数并不使用重力。spa

  • bool SimpleMove(Vector3 speed);

Descriptionorm

Moves the charactor with speed.ip

Velocity along the y-axis is ignored.Speed is in meters/s.Gravity is automatically applied.Returns if the character is grounded.It is recommended that you make only one call to Move or Simple per frame.ci

Y轴的速度将会被忽略。速度单位时米每秒。重力自动生效。返回值是角色是否着地(bool),建议每帧调用一次Move或者SimpleMove。it

 

最近作了一个小项目,讲师又给咱们介绍了一种新的控制人物移动的方法:CharacterController,主要用于人物模型的移动,主要是Move和Simple Move两个方法。io

今天使用SimpleMove的时候,人物并不能移动,后来才发现我是这样写的:SimpleMove(transform.forword * speed *time.deltatime); 找错还找了很久,后来才发现,speed*time.deltatime是什么鬼,m/s * m/s = (不知道) qwq;因此后面参数直接是速度就OK;function

相关文章
相关标签/搜索