I’m trying to get my First Person Controller to “crouch” with this script, and I am getting some big errors. Apparently Player.transform.position.y and Player.transform.localScale.y are not variables that I can set. Does anybody know the proper syntax of what I am trying to access and alter? Here is the code:
1 public void Update()
2 {
3 if(Input.GetButtonDown("Crouch"))
4 {
5 Player.transform.position.y -= .5;
6 Player.transform.localScale.y -= .5;
7 Crouch = true;
8 }
9 }