Hey guys, So I am trying to make my first person character climb the mountain. I have made the physics just about right. Now I want a good input system to make my character climb. This is what I am trying to achieve. User clicks mouse 0 which plays the right hand animation going up and latching the wall. Now I want the user to click mouse 1 which would play the left hand anim for latching the waill. After that the user moves upward with some velocity. The process repeats everytime when the user gives that input. Here is my input code. Code (csharp): if(Input.GetMouseButtonDown(0)) { upMovement = true; //curTime = Time.time; playRightHandUpAnim = 1; //print("FIRST"); yield WaitForSeconds(0.1f); playRightHandUpAnim = 0; print("NOW"); yield WaitForSeconds(0.1f); if(Input.GetMouseButtonDown(1)) { playLeftHandUpAnim = 1; //print("SECOND"); yield WaitForSeconds(0.2f); playLeftHandUpAnim = 0; playLeftHandDownAnim = 1; playRightHandDownAnim = 1; yield WaitForSeconds(0.2f); playLeftHandDownAnim = 0; playRightHandDownAnim = 0; //print("CLIMB"); verticalMove = climbDirection.normalized; verticalMove *= climbSpeed; lateralMove = Vector3.zero; } } else{ upMovement = false; } I have used the yield to have a minor pause for the animations to play correctly. I know I am missing out on something.Hope someone can help ! Thanks!
mouse 0 is the left button, wouldn't it make more sense for that to be the left hand? edit: you also cannot use yield directly in the update() function... http://docs-jp.unity3d.com/Documentation/ScriptReference/index.Coroutines_26_Yield.html