CharacterController.center 中心

var center : Vector3

Description描述

The center of the character's capsule relative to the transform's position.

相对于变换位置的角色胶囊体的中心。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	public CharacterController controller;
	public void Awake() {
		controller = GetComponent<CharacterController>();
		controller.center = new Vector3(0, 1, 0);
	}
}
// Move the center of the capsule up.
//将胶囊体的中心向上移动

var controller : CharacterController;
controller = GetComponent(CharacterController);
controller.center = Vector3(0, 1, 0);
最后修改:2010年12月14日 Tuesday 13:37

本脚本参考基于Unity 3.4.1f5

英文部分版权属©Unity公司所有,中文部分© Unity圣典 版权所有,未经许可,严禁转载 。