- Home /
Question by
Veywna · Jun 12, 2014 at 05:10 AM ·
2d-platformerjumpingkey pressedtransform.
CS1525 unexpected symbol thisTranslate
I had a class a few semesters ago over C#, and I remember most of it, but I'm not at all sure what's going on here. I'm trying to make a 2D character jump when the Space bar is pressed.
// Update is called once per frame
void Update () {
//Transform variable for the object we want moved, and float to modulate the speed.
Transform thisTransform;
float f_Speed = 5;
//If the Space bar is pressed, Translate thisTransformation upwards on Vector2.
if (Input.GetKeyDown (KeyCode = Space){
thisTransform.Translate (Vector2.up / f_Speed)
}
}
Comment
@mattyman174 gave you the reason for error.
For future reference about errors: What are the c# error messages?
Answer by mattyman174 · Jun 12, 2014 at 05:11 AM
thisTransform.Translate (Vector2.up / f_Speed);
You missed a semi colon on the end of this line.
If this corrected your error can you please accept the Answer to close this question, thank you.