|
I'm having multiple problems lately one being - How would I be able to do an if statement with functionality when player press (W || S) and Fire1 Button to play the animation from W||S or up arrow key and down arrow key. I want to make my player play the animation for "Fire1" only when the Up arrow Keyy, Down arrow Key and W, S key are NOT pressed. Also I want a force to be added to my player once the "fire1" button is Up to move the player the direction he is facing. I did a code like - if (Input.GetButtonUp("Fire1")) { animation.Stop("jump"); rigidbody.AddForce (100, 0, 0); } How come no force is added to move my player? Final question I have - How can I develop a script add focre to my player for length of time he is holding down the "w" key, but then stop once he reaches a max speed,but then slow down if pressing "s"? Thank you so much!
(comments are locked)
|
|
For your first question: This will make sure that something will only happen when you haven't pressed one of your vertical axis buttons.
(comments are locked)
|
