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

Why AddForce up is higher than AddForce right?

$
0
0
Hi, i want to hit enemy and move the enemy up or right depending on animation and using same force speed, but when i do that addforce up launches far in sky not like addforce right using same force speed. float forceSpeed=100; bool up=false; bool right=false; // in update if (Input.GetKeyDown(KeyCode.R)) up = true; else if (Input.GetKeyDown(KeyCode.F)) right = true; // in fixed update if (up) { GetComponent().AddForce(Vector3.up * forceSpeed); up = false; } else if (right) { GetComponent().AddForce(Vector3.right * forceSpeed); right = false; } not same outcome, different magnitude. mass=1, drag=0, angdrag=0.05, use gravity=true, not using physicsMaterial on gound.

Viewing all articles
Browse latest Browse all 1264

Trending Articles



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