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

Rigidybody2D addforce at constant speed

$
0
0
Attempting an infinite 2d runner, but when I use rigibody2D.addforce it slowly accelerates to insanely fast regardless of what I multiply it by... enter code here#pragma strict var myForce : float = 20; var jumpForce : float = 600; function Update() { if(Input.GetKeyDown(KeyCode.Space)) { rigidbody2D.AddForce(new Vector2(0, jumpForce )); } } function FixedUpdate () { rigidbody2D.AddForce(new Vector2(myForce, 0)); }; Even if I change myForce to 10 it starts slowly and eventually picks up crazy amounts of speed. All I want is a constant movement speed. Thanks in advance.

Viewing all articles
Browse latest Browse all 1264

Trending Articles



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