I’ve tried using other peoples solutions, but they’re either outdated and not formatted right for my version of unity or they just dont work for me.
#pragma strict
var rotationSpeed = 100;
var jumpHeight = 8;
private var isFalling = false;
function Update ()
{
//Ball Rotation
var rotation : float = Input.GetAxis ("Horizontal") * rotationSpeed;
rotation *= Time.deltaTime;
GetComponent.<Rigidbody>().AddRelativeTorque (Vector3.back * rotation);
if (Input.GetKeyDown(KeyCode.W) && isFalling == false) {
Rigidbody.velocity.y = jumpHeight;
isFalling = true;
}
}
function onCollisionStay ()
{
isFalling = false;
}