CS1002 (25,31) pls help

using UnityEngine;

public class PlayerMovement : MonoBehaviour {

public Rigidbody rb;

public float forwardForce = 2000f;
public float sidewaysForce = 500f;

// Update is called once per frame
void FixedUpdate ()
{
rb.AddForce(0, 0, forwardForce * Time.deltaTime);

if ( Input.GetKey(“d”))
{
rb.AddForce(sidewaysForce * Time.deltaTime, 0, 0, ForceMode.VelocityChange);
}

if (Input.GetKey(“a”))
{
rb.AddForce(-sidewaysForce * Time.deltaTime, 0, 0, ForceMode.VelocityChange);
}

if (rb.position.y < -1y)

FindObjectOfType().EndGame1();
}
}
}

Remember: NOBODY memorizes error codes. The error code is absolutely the least useful part of the error. It serves no purpose at all. Forget the error code. Put it out of your mind.

The complete error message contains everything you need to know to fix the error yourself.

Always start with the FIRST error in the list, as sometimes that error causes or compounds some or all of the subsequent errors.

The important parts of the error message are:

  • the description of the error itself (google this; you are NEVER the first one!)
  • the file it occurred in (critical!)
  • the line number and character position (the two numbers in parentheses)

All of that information is in the actual error message and you must pay attention to it. Learn how to identify it instantly so you don’t have to stop your progress and fiddle around with the forum.

How to understand compiler and other errors and even fix them yourself:

If you post a code snippet, ALWAYS USE CODE TAGS:

How to use code tags: Using code tags properly

Beyond that, AFTER you have exhausted all your steps above,

How to report your problem productively in the Unity3D forums:

http://plbm.com/?p=220

2 Likes

Put some effort into asking for help please. You actively deleted the useful stuff from the error, only leaving us with the code and the line number. The latter would still be kinda helpful, if there were any lines to compare it to. Which there are not, because you did not use code tags. So what do you expect people here to do? Manually count lines to see what could possibly be wrong on line 25? Google the error code to figure out what your problem may be? How about a description. Some actual text. And be it only to show some effort being made. While you are at it, a title that describes the problem would also be a great place to start. Have you ever googled something and found a great answer that helped you with a problem? Nice! Now ask yourself whether that would have happened, if everybody just named their threads “help pl0x”.

You may ask why i’m ranting about this so much. That’s easy. Because i’m one of those people who, despite the lack of effort put into the post and despite every last piece of helpful information or formatting compeltely missing, i’ll still do just that. Count line numbers and see what could possibly be wrong with your code. You are missing an opening curley bracket for your if statement there. And next time please make it easier on people to help you.

5 Likes

As stated by the above posts, please put some effort in to posting. Read the rules, look at other posts, post useful information and use code tags.

closed.

2 Likes