Quantcast
Channel: Answers for "Why does this piece of code work with gravity and this one dosent"
Viewing all articles
Browse latest Browse all 4

Answer by Rostam24

$
0
0
When I changed every rigidbody in my game to rigidbody2d, I had the same problem. Eventually, I ended up using rigidbody2d.AddForce for everything. Setting velocity or moveposition in one place would overwrite what I did in other places. I have no idea why that happened (I'm still pretty new to Unity), but using addforce was the solution for me.

Viewing all articles
Browse latest Browse all 4

Trending Articles



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