Hi,
I am getting so uneven jump even though i am not using DeltaTime in addForce…Please check the code snippet below:
void FixedUpdate ()
{
grounded = Physics2D.OverlapCircle (groundCheck.position, groundRadius, whatIsGround);
//anim.SetFloat (“vSpeed”, rb.velocity.y);
Vector3 pos = transform.position;
pos = new Vector3 (pos.x - speed * Time.deltaTime, pos.y, pos.z);
transform.position = pos;
Vector3 min = Camera.main.ViewportToWorldPoint (new Vector3 (0, 0, 0));
if (transform.position.x < min.x) {
Destroy (gameObject);
}
if (this.gameObject.transform.position.x < -1 && this.gameObject.transform.position.x > -5) {
//anim.SetBool ("Attack", true);
if (is_jump == false) {
if (grounded == true) {
rb.AddForce (new Vector2 (-10f, jumpforce));
//rb.AddForce (transform.position * jumpforce * Time.deltaTime);
//rb.AddForce (Vector2.up * 1.5f, ForceMode2D.Impulse);
//transform.position = new Vector3 (pos.x - 100f * Time.deltaTime, pos.y, pos.z);
is_jump = true;
}
anim.SetBool ("Jump", true);
if (anim.GetCurrentAnimatorStateInfo (0).IsName ("EnemyJump")) {
anim.SetBool ("Jump", false);
}
}
} else if (this.gameObject.transform.position.x <= -5) {
anim.SetBool ("Jump", false);
}
}