Question by
muhammadtahiriqbal · Mar 05, 2018 at 07:26 AM ·
unity 5collisionrigidbody
Unity Ball moving inside the surface
ball is jumping on 3d circle sometime stuck inside the circle.ball has rigidbody and its continuous dynamic and circle also have mesh collider. ball jump code..
if(Mathf.Sign(rg.velocity.y)==-1){
isforceApplied=true;
}
void OnCollisionEnter(Collision collisionInfo) {
if(isforceApplied==true){
isforceApplied=false;
rg.AddForce(transform.up*forceAmount,ForceMode.Impulse);
}
}
webpnet-gifmaker.gif
(78.4 kB)
-3.jpg
(15.9 kB)
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612153951im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Need a script to stick rigid body to any rigid body it comes into contact with. 1 Answer
How to make physics collisions act like in old games (NES, SNES especially) 1 Answer
Object shakes on collide! 1 Answer
Detecting collisions on an invisible grid 0 Answers
Unity 5: AddForce Increases power when already being pushed towards a collider. How to make stop? 1 Answer