- Home /
Simple Jump script
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.
Comment
Answer by Xarbrough · Apr 05, 2015 at 06:21 AM
Follow the excellent official live training: http://unity3d.com/learn/tutorials/modules/beginner/live-training-archive/creating-a-basic-platformer-game
Your answer
Follow this Question
Related Questions
Lerp jump using input won't convert to world space 1 Answer
Rigidbody Jumping for Character Controller 1 Answer
How do I define the speed of my player in the y axis? 3 Answers
Trying to create a jump script without velocity 3 Answers
trying to make a object in unity jump with accelerometer, not working. 0 Answers