When my player object jumps on a higher terrain, it doesn't jump nearly as high. Here's my jump code.
#pragma strict
var BounceObj : GameObject;
var jumpHeight : float;
function Start () {
}
function Update () {
}
function OnCollisionStay2D (col : Collision2D ) {
if( col.gameObject.name== BounceObj.name && Input.GetKey(KeyCode.W)) {
rigidbody2D.AddForce (Vector2 ( 0, jumpHeight * 10 ));
}
}
![alt text][1]
[1]: /storage/temp/29169-capture.jpg
So when the cube player goes on the higher ground and I jump, it doesnt jump as high as if it were on the lower floor.
↧