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);
}
}