Jump, if I touch button,Jump if I pres the touch button
Hey :) I need help! I cant finde a code, that I (my character) can jump.
I want, that my character jump, if I touch the button.
My code:
using System.Collections; using System.Collections.Generic; using UnityEngine;
public class jumptouch : MonoBehaviour {
void Start()
{
//touch
if (Input.touches.Length > 0)
{
//touch
if (Input.touches[0].phase == TouchPhase.Began)
{
[()] } }
}
} , Hey :) I want, that my character jump and I have this code now. Now I need to creat a code that my character jump, if I press the button. Please help me :(
using System.Collections; using System.Collections.Generic; using UnityEngine;
public class jumptouch : MonoBehaviour {
void Start()
{
//touch if (Input.touches.Length > 0) { //touch if (Input.touches[0].phase == TouchPhase.Began) {
}
}
}
}
Your answer
Follow this Question
Related Questions
How can I modify this to allow jumping with space? 0 Answers
Need help with Character Jump! 0 Answers
isGrounded not working,is grounded stops players from jumping 1 Answer
Why does AddForce have various results? 0 Answers
How to put delay after input key 0 Answers