my crouch script isnt working

if (Input.GetKeyDown ("Crouch")) {
    transform.localScale.y = 0.5;
}
(Input.GetKeyUp ("crouch")) {
    transform.localScale.y : 1 
};

This is what i have so far, this is my first script and it is placed inside the First Person Controller can someone help me to figure out why it isnt working please.

There are several things wrong with the second half of your code:

  • You have no if before the Input.GetKeyUp.
  • You check a key "crouch" which is different from the "Crouch" you entered previously if the Input functions are case sensitive.
  • You indicate transform.localscale.y to be of type 1 with the use of : (colon). 1 is not a type.
  • You don't assign the value of transform.localscale.y so once it is set to 0.5, it will stay 0.5.
  • You are missing a semi-colon at the end of the line where you indicate transform.localscale.y to be of type 1.

You got it wright in the first half. Why didn't you just copy/paste the first part and change Down to Up and 0.5 to 1?

Thx for the help ill try it out soon