this is the program
if (Input.GetKeyDown (KeyCode.A)) {
GetComponent()transform.localScale.x = -14;
}
Error expecting ‘;’
Error Unexpected sumbol ‘.’ expecting ‘)’,‘,’,‘;’,‘[’, or ‘=’
anyone know what I’m doing wrong?
this is the program
if (Input.GetKeyDown (KeyCode.A)) {
GetComponent()transform.localScale.x = -14;
}
Error expecting ‘;’
Error Unexpected sumbol ‘.’ expecting ‘)’,‘,’,‘;’,‘[’, or ‘=’
anyone know what I’m doing wrong?
No big deal, you are just using GetComponent() a bit wrong.
If you need to use GetComponent there are a few ways to do it, but by the looks of things you shouldnt need to, simply use:
if (Input.GetKeyDown (KeyCode.A)) { transform.localScale.x = -14; }
or better yet
if (Input.GetKeyDown (KeyCode.A)) { transform.localScale.x = -transform.localScale.x; }