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

rigidbody2d.addforce for is not working for the x axis

$
0
0
i made it that when my character gets hurt or hit by an enemy it gets pushed by a pushback force caused by the damage by using addforce. The only problem is that the addforce only works for the y axis not the x even though its supposed to work for both, hears the code. if (pushback) { GetComponent().AddForce( new Vector2(pushbackforcex,pushbackforcey),ForceMode2D.Impulse); pushback = false; }

Viewing all articles
Browse latest Browse all 1264

Trending Articles



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