можно сделать все намного проще
[SerializeField] private float SittingValue;
private void Update()
{
OnSit();
}
public void OnSit()
{
if (Input.GetKey("s"))
{
transform.localScale = new Vector3(transform.localScale.x, SittingValue, transform.localScale.z);
}
else
{
transform.localScale = new Vector3(transform.localScale.x, 1f, transform.localScale.z);
}