多米诺 发表于 2012-6-15 15:30

Unity3D最简单的 角色控制代码 Character Control

protected Vector3 move = Vector3.zero;
public float
moveSpeed=3f;//速度
protected CharacterController control;//绑定的角色碰撞对象control =
GetComponent<CharacterController> ();
move =new
Vector3(Input.GetAxis("Horizontal"),0,Input.GetAxis("Vertical"));
control.SimpleMove
(move*moveSpeed);

HLH 发表于 2013-5-2 17:40

谢谢分享 试试先!

SingaoFPS 发表于 2016-9-3 20:09


感谢楼主的无私分享!

289256986 发表于 2017-10-23 14:22

很不错

傲血狂劍 发表于 2017-10-23 13:59

楼主是超人

anewge 发表于 2017-10-23 14:18

好帖就是要顶

289256986 发表于 2017-10-23 13:57

说的非常好

bh6821935 发表于 2017-10-23 13:29

LZ真是人才

ao1shib1234 发表于 2017-11-5 07:57

很不错

Johnny 发表于 2017-11-5 08:22

好帖就是要顶
页: [1]
查看完整版本: Unity3D最简单的 角色控制代码 Character Control