- Home /
This post has been wikified, any user with enough reputation can edit it.
Question by
Orion_Reed · Mar 16, 2013 at 11:27 PM ·
errorgravityparsingstupid
Getting a parsing error, cant see the problem
This is stupid, but i cant for the life of me see where i went wrong. Any help greatly appreciated
using UnityEngine;
using System.Collections;
public class GravityShift : MonoBehaviour
{
void Update ()
{
if (!RotateTriggers.canRotate && !isOnWall)
{
rigidbody.AddForce(new Vector3(0, -gravity * rigidbody.mass, 0));
}
if (RotateTriggers.canRotate)
{
Quaternion localRot = Quaternion.FromToRotation(-transform.up, Vector3.right) * transform.rotation;
transform.rotation = Quaternion.RotateTowards(transform.rotation, localRot, 10);
rigidbody.AddForce(new Vector3(gravity * rigidbody.mass, 0, 0));
}
if (RotateTriggersWall.canRotateToWall)
{
if (Input.GetButtonDown("Jump"))
isOnWall = true;
}
if (isOnWall)
{
Quaternion localRot = Quaternion.FromToRotation(-transform.up, Vector3.right) * transform.rotation;
transform.rotation = Quaternion.RotateTowards(transform.rotation, localRot, 10);
rigidbody.AddForce(new Vector3(gravity * rigidbody.mass, 0, 0));
}
}
}
}
}
Comment
Best Answer
Answer by robertbu · Mar 16, 2013 at 11:30 PM
You have two extra '}' at the bottom of your file. Note in Mono if you place your cursor at one '{' or '}' it will find highlight the other bracket.
thanks for that about $$anonymous$$ono as well, i was wondering why other brackets where being selected :)
Your answer
Follow this Question
Related Questions
help my code has error CS8205 :parsing error how can I fix? 2 Answers
Getting a "type expected" error on WaitForSeconds 2 Answers
Parsing error CS8025 0 Answers
Official Unity Space Shooter Tutorial 1 Answer
I need help with an error 1 Answer