i use Unity5
I have an object that I put the scale of it is (0.2,0.2,0.5) and I make my object double jumps. It’s work
But when I adjust the size scale is (0.5,0.5,0.5), then it can not double jump. Double Jump not work i Really don’t understand . help me this problem
using UnityEngine;
using System.Collections;
public class GiantScript : MonoBehaviour
{
Animator anim;
public bool grounded, doubleJump, jumping;
public Rigidbody2D rid;
public float jump;
public GameObject ground;
public LayerMask mask;
// Use this for initialization
void Start ()
{
anim = GetComponent<Animator> ();
}
// Update is called once per frame
void Update ()
{
grounded = Physics2D.Linecast (transform.position, ground.transform.position, mask);
if (grounded) {
jumping = false;
doubleJump = false;
}
if (Input.GetMouseButtonDown (0) && grounded && !doubleJump) {
jumping = true;
doubleJump = true;
rid.velocity = new Vector3 (0, 50 * jump, 0);
}
if (Input.GetMouseButtonDown (0) && !grounded && doubleJump) {
rid.velocity = new Vector3 (0, 60 * jump, 0);
doubleJump = false;
}
anim.SetBool ("GiantRun", grounded);
anim.SetBool ("GiantJump", jumping);
}
}