Quantcast
Channel: Questions in topic: "footsteps"
Viewing all articles
Browse latest Browse all 164

Convert "SHIFT" button for running to Mobile?

$
0
0
I have this script (courtesy of Alucardj) and it is a script for running and playing the footstep sounds. Now since I am trying to apply this script (which is for PC) into my Android game, how will I be able to convert the "hold the shift button to run" mechanic, into "hold the right touch pad to run"? Here is the portion of the script: function SetSpeed() { var speed = walkSpeed; if ( chCtrl.isGrounded && Input.GetKey("left shift") || Input.GetKey("right shift") ) { speed = runSpeed; } chMotor.movement.maxForwardSpeed = speed; } function PlayFootsteps() { if ( Input.GetAxis( "Horizontal" ) || Input.GetAxis( "Vertical" ) ) { if ( Input.GetKey( "left shift" ) || Input.GetKey( "right shift" ) ) { // Running isWalking = false; isRunning = true; } else { // Walking isWalking = true; isRunning = false; } } else { // Stopped isWalking = false; isRunning = false; }

Viewing all articles
Browse latest Browse all 164

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>