纳金网
标题:
最简单的character controller角色控制_代码
[打印本页]
作者:
她。
时间:
2012-6-29 14:32
标题:
最简单的character controller角色控制_代码
var oldman_:GameObject;
var***n_Speed_:float=3.0;
var rotate_Speed_:float=3.0;
function Start()
{
oldman_=GameObject.Find("oldman");
var common***n_=animation["common***n"];
common***n_.layer=1;
common***n_.wrapMode=WrapMode.Loop;
}
function Update () {
var cc_ : CharacterController = GetComponent(CharacterController);
cc_.SimpleMove(transform.TransformDirection(Vector3.forward)***n_Speed_*Input.GetAxis("Vertical"));
cc_.transform.Rotate(0,Input.GetAxis("Horizontal")*rotate_Speed_,0);
}
复制代码
另外ad是位移的:
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);
作者:
难骑
时间:
2012-6-29 14:45
提示:
作者被禁止或删除 内容自动屏蔽
欢迎光临 纳金网 (http://rs.narkii.com/club/)
Powered by Discuz! X2.5