The game line runner for android … the question is how it’s done for the game and make 3 different jumps pressures depending on how the screen … I’ve looked on youtube and forums etc … na na. but … only some Java script … and I want C #
using UnityEngine;
using System.Collections;
public class ControladorPersonaje : MonoBehaviour {
public float fuerzaSalto = 100f;
private bool corriendo = false;
public float velocidad = 1f;
private bool enSuelo = true;
public Transform comprobadorSuelo;
private float comprobadorRadio = 0.07f;
public LayerMask mascaraSuelo;
void FixedUpdate(){
if(corriendo){
rigidbody2D.velocity = new Vector2(velocidad, rigidbody2D.velocity.y);
}
enSuelo = Physics2D.OverlapCircle(comprobadorSuelo.position, comprobadorRadio, mascaraSuelo);
}
void Update () {
if(Input.GetMouseButtonDown(0)){
if(corriendo){
// Hacemos que salte si puede saltar
if(enSuelo){
rigidbody2D.velocity = new Vector2(rigidbody2D.velocity.x, fuerzaSalto);
}
}else{
corriendo = true;
}
}
}
}