Game Development Reference
In-Depth Information
//Move Params
private var f_verticalSpeed : float = 0.0;
private var f_moveSpeed : float = 0.0;
private var v3_moveDirection : Vector3 = Vector3.zero;
//Boolean
private var b_isRun : boolean;
private var b_isBackward : boolean;
private var b_isJumping : boolean;
//Rotate Params
private var q_currentRotation : Quaternion; //current rotation of
the character
private var q_rot : Quaternion; //Rotate to left or right
direction
private var f_rotateSpeed : float = 1.0; //Smooth speed of
rotation
//Direction Params
private var v3_forward : Vector3; //Forward Direction of the
character
private var v3_right : Vector3; //Right Direction of the character
private var c_collisionFlags : CollisionFlags; //Collision Flag
return from Moving the character
//Create in air time
private var f_inAirTime : float = 0.0;
private var f_inAirStartTime : float = 0.0;
private var f_minAirTime : float = 0.15; // 0.15 sec.
Here, we have all the necessary parameters to use in our script. In the first line, we
want to make sure that we have the character controller script atached when we use
this script. Then, we have the animaion clip parameters to contain all the animaion
that we want to play when we control our character. Next, we have the animaion
speed to control how fast we want our animaion clip to play when it uses. We also
have the speed for the walk, run, jump and gravity parameters. We need the gravity
property because we will use the Move() funcion in the CharacterController
class, which doesn't have the gravity parameter included.
 
Search WWH ::




Custom Search