Quantcast
Channel: Questions in topic: "addforce"
Viewing all articles
Browse latest Browse all 1264

Rigidbody2d addforce is weaker at a higher y position.

$
0
0
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.

Viewing all articles
Browse latest Browse all 1264

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>