Quantcast
Channel: Latest Questions by neejammer
Viewing all articles
Browse latest Browse all 8

How to Bump back (opposite direction of being hit) Addforce

$
0
0
I want a sphere to bump back on collision with another object. So in the opposite direction of the point its being hit. With my current code the sphere does bouce back. however it always goes backwards. (Not always the right direction from where its being hit) here's my code: function OnCollisionStay(collision : Collision) { // Check if the collider we hit has a rigidbody // Then apply the force if (collision.rigidbody) { collision.rigidbody.AddForce (-Vector3.forward * 5); } }

Viewing all articles
Browse latest Browse all 8

Trending Articles



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