I need a simple jump script for a 2d game.
#pragma strict
var mySpeed = 100;
function Start () {
InvokeRepeating("Multiplier", 0, .1);
}
function Update () {
GetComponent.<Rigidbody2D>().velocity = Vector2(mySpeed,0);
if (Input.GetButtonDown ("Space"))
{
//Jump script should go here
}
}
function Multiplier ()
{
mySpeed++;
}
I am relatively new to unity so please give me any suggestions in changing my scripts.