- Home /
This question was
closed Nov 21, 2014 at 04:05 AM by
robertbu for the following reason:
Duplicate Question
Question by
Rex226 · Nov 21, 2014 at 04:05 AM ·
errorparsingparsing error
How do I fix this really wierd parsing error?
Here is the code:
using UnityEngine; using System.Collections;
public class PaddleScript : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
transform.Translate (10f * Time.deltaTime * Input.GetAxis ("Horizontal"), 0, 0);
}
void OnCollisionEnter( Collision col) {
foreach (ContactPoint contact in col.contacts) {
if( contact.thisCollider == Collider) {
float english = contact.point.x - transform.position.x;
contact.otherCollider.rigidbody.AddForce( 300f * english, 0, 0)
}
}
}
}
An error shows up and says "Assets/Sripts/PaddleScript.cs(23,25): error CS1525: Unexpected symbol `}'" But when I remove the '}', it says there is a Parsing error ...? Does anyone know why??
Comment
You are missing a ';' at the end of 17. Also on like 14, 'Collider' should be a 'collider' with a lower case 'c'.