i want to be able to add speed to my controller if i hold down shift. it works, but i need to go back to default speed when the key is released.
this is probably simple in scripting matter. but im not that experienced yet.
this is what ive come up to, and it does not go back to default speed wich is 10.
any help is appreciated.
if (Input.GetKey(KeyCode.LeftShift)){
speed = 12;
}
You can probably get an idea by looking at this. Also it’s generally a good idea to stay away from GetKey, unless you plan on writing your own input manager; use GetButton instead.
–Eric
thanks 
i did not plan to write my own input manager. the default one just lacked that key
That’s what the Unity input manager is for…you go there and set up a run button to be whatever you want.
–Eric
havent been creating my own input management yet, but i havent had the need because of my minor projects.
but i will keep it in mind.
thanks for sharing
not that creative in scripting but it did work this way…
if (Input.GetKey(KeyCode.LeftShift)){
speed = 12;
}
if (!Input.GetKey(KeyCode.LeftShift)){
speed = 10;
}
What I mean is, go to the input manager in Unity, and set up a “Run” key; it takes about 10 seconds.
–Eric
ye, i know how to do that. its a pretty simple thing 
did not solve my scripting issue though.
anyway the difference between getbutton and getkey is visually not that big, except management. i have no idea if there are any deeper problems with getkey, but it generally works. but thats another story
anyway thank you anyway for the link