Hey I am new to the forums and I need a bit of help.
I am currently coding my 2D game for Android and ran into a parsing error along the way. I am coding in C# and I can not seem to get shut of this error, I have tried closing and opening the brackets and still nothing. Any help would be appreciated. Thanks.
// Die by being off screen
Vector2 screenPosition = Camera.main.WorldToScreenPoint(transform.position);
if (screenPosition.y > Screen.height || screenPosition.y < 0)
{
Die();
}
}
// Die by collision
void OnCollisionEnter2D(Collision2D other)
{
Die();
}
public void Die() {
Application.LoadLevel(“gameover”);
Like hpjohn said, you have some code just floating out there (the code circled is not in a method for example.) Looking at your class, I cannot even suggest where it should go because it uses variables that don’t seem to exist (jumpForce). Comment that set of code out, or move it into a function and define jumpForce.