- Home /
 
               Question by 
               Pat7ric · Jan 15, 2018 at 07:14 PM · 
                scripting problemmovementscripting beginnermovement scriptmovements  
              
 
              What should i write that when i press "Shift" it will speed up idk how shift is named? Here's the code:
if(Input.GetKey("KeyCode.Shift")) transform.Translate(Vector3.forward acceSpeed Time.deltaTime);
               Comment
              
 
               
               
               Best Answer 
              
 
              Answer by Legend_Bacon · Jan 15, 2018 at 07:17 PM
Hello there,
You can use KeyCode.LeftShift, Keycode.RightShift, or both. You could also define it as a button and use that instead. HERE is a link that could get you started with that.
Hope that helps!
Cheers,
~LegendBacon
Your answer
 
 
             Follow this Question
Related Questions
How to code a burst of speed? 1 Answer
How can I make my 2D sprite move in the direction of the most recent key pressed? 1 Answer
How do i maintain the same speed in the air? 1 Answer
How do I build up speed while wallrunning? 1 Answer
Rotate game object and then return to its original rotation 1 Answer
 koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                