Help a non programmer

I am not a programmer, but I have this script I got, and I want to test it really soon. Unfortunately, unity keeps bugging me about “Unknown Identifiers”, and I (being not a programmer) am in need of resolution of this ungainly problem.

P.S. If you like the script, feel free to use it.

function FixedUpdate () { 
   gravityUp = attractor.position - transform.position; // away from center
   gravityUp.z = 0; // spin gravity 
   gravityUp.Normalize(); 
    
   heading += 90 * Input.GetAxis("Horizontal") * Time.deltaTime; 
   heading = heading > 360 ? heading - 360 : heading; 
   heading = heading < 0 ? heading + 360 : heading; 
    
   transform.rotation = Quaternion.FromToRotation(Vector3.up, gravityUp) * Quaternion.AngleAxis(heading, Vector3.up); 
    
   angleDelta = Vector3.Angle(gravityUp, transform.up); 
    
   localForward = transform.forward; 
    
   rigidbody.AddForce( gravityUp * fauxGravity * rigidbody.mass ); 
    
   if (Input.GetAxis("Vertical") > 0.2){ 
      rigidbody.AddForce(localForward * rigidbody.mass * 10); 
      // Unsatisfactory voodoo to let me move on bumpy terrain 
      rigidbody.AddForce(gravityUp * rigidbody.mass * 5); 
   } 
    
   if (grounded  Input.GetButton ("Jump")){ 
      rigidbody.AddForce(gravityUp * rigidbody.mass * jumpForce); 
   } 
    
}

im not a programmer but i constantly have the same problem. is the ‘identifier’ spelled correctly? is there a ‘var (etc.)’ thing at the beginning telling what the identifier means? if not, try to fix that. that’s all i can say tho. oh, and what does the script do? (or what is it meant to do?)

Read this: http://unity3d.com/support/documentation/Manual/Scripting.html

The section named the power of variables would help.

I can see AT LEAST one problem.

// I think this is right - I don't do Javascript!!! :)
var gravityUp : Vector3;

Ta

JT

The script is rotational gravity around one axis (think tin can on it’s side, spinning on the horizontal axis, with you on the inside). Based on what’s his name’s planetoid gravity script. I guess I’ll just have to add the variables myself.

ok

I’m a bit confused… Were you wanting somebody to type them in for you? You need a secratary! :wink:

JT

Nah. I just need my remote programmer to be more timely . :wink:

Yeah, I was. Guess I need to learn JavaScript