- Home /
Question by
awaisahmad · Jun 10, 2018 at 11:27 AM ·
character controllerheight
character controller height transition
Hi i want to change my character controller height to change smoothly not suddenly like it change its height with specified time like 2, 3 seconds currently it change its height suddenly by multiplier which is 2 kindly help.
this is my script
private void StartSliding ()
{
anim.SetBool ("Sliding", true);
controller.height /= 2 ;
controller .center = new Vector3 (controller .center .x ,controller.center .y/2 ,controller .center .z);
}
private void StopSliding ()
{
anim.SetBool ("Sliding", false );
controller.height *=2 ;
controller .center = new Vector3 (controller .center .x ,controller.center .y*2 ,controller .center .z);
}
Comment
Your answer
Follow this Question
Related Questions
Character Controller Crouch With transform.localScale Problem. 1 Answer
Player Inconsistent Jumps 0 Answers
A Character Controller with another shape. 0 Answers
CharacterController how to disable acceleration of falling when moving in the air? 1 Answer
OnControllerColliderHit, hit.normal direction is unstable 0 Answers