i need help jump script c#
Hi !
i tried to build my own jumping script but i failed so please can i use any help ??
anything can help me to build it
Comment
Answer by AlexK1992 · Sep 26, 2016 at 06:48 PM
Rigidbody2D rigid;
void Start () {
rigid = GetComponent<Rigidbody2D>();
}
void Update () {
if(Input.GetKeyDown(KeyCode.Space)){
Debug.Log("JUMP");
rigid.velocity = new Vector2 (0f, 10f);
}
}
Your answer
Follow this Question
Related Questions
How do i make character JUMP? 1 Answer
Unity GetComponent Script? 1 Answer
Saving Data (please help) 0 Answers
Audio on keydown Won't stop 1 Answer
I create material with script but it does not render right 0 Answers