When you’re fixing syntax errors, clear the console, scroll up to the first error and start from the top. (often one error will cause more to be reported, which is why you want to start there) Get used to spotting the obvious stuff like missing parenthesis, invalid assignments and missing braces.
lol yeah i can script but fixing errors is not my strong suit i was born with dislexia and dislexia makes it hard to learn i havn’t been scripting for a long time maybe like 1 month im not trying to label myself thou and if you or anyone really can help me understand how to fix errors on script i would be very thankfull to you or anyone that helped me and oh yeah im 13yr :3 im trying to get into the game industry :3
var move : float;
var jumpsound : AudioClip;
private var jump : boolean;
function FixedUpdate ()
{
if(Input.GetKey("d")) //Let's put spaces between each "if" statement to make the code easier to read!
{
rigidbody.AddForce (Vector3.right * -1 * move);
}
if(Input.GetKey("a"))
{
rigidbody.AddForce (Vector3.right * 1 * move);
}
if( (Input.GetKey("space")) (jump))
{
rigidbody.AddForce (Vector3.up * move * 20);
}
}//<-End of FixedUpdate.
//I put 4 spaces between each function to make the code more readable!
function OnCollisionEnter()
{
jump = true; //I removed : because that doesn't belong there!
}
function OnCollisionExit() //I removed the ; from the ends of the functions because they don't go there!
{
jump = false;
}
Note, that anything the character collides with will allow him to jump again, even if he hits his head into the ceiling.