Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to collide objects with high speed in Unity
    primarykey
    data
    text
    <p>I try to create game for Android and I have problem with high speed objects, they don't wanna to collide.</p> <p>I have Sphere with Sphere Collider and Bouncy material, and RigidBody with this param (Gravity=false, Interpolate=Interpolate, Collision Detection = Continuous Dynamic)</p> <p>Also I have 3 walls with Box Collider and Bouncy material.</p> <p>This is my code for Sphere</p> <pre><code>function IncreaseBallVelocity() { rigidbody.velocity *= 1.05; } function Awake () { rigidbody.AddForce(4, 4, 0, ForceMode.Impulse); InvokeRepeating("IncreaseBallVelocity", 2, 2); } </code></pre> <p>In project Settings I set: "Min Penetration For Penalty Force"=0.001, "Solver Interation Count"=50</p> <p>When I play on the start it work fine (it bounces) but when speed go to high, Sphere just passes the wall.</p> <p>Can anyone help me?</p> <p>Thanks.</p> <p>Edited</p> <pre><code>var hit : RaycastHit; var mainGameScript : MainGame; var particles_splash : GameObject; function Awake () { rigidbody.AddForce(4, 4, 0, ForceMode.Impulse); InvokeRepeating("IncreaseBallVelocity", 2, 2); } function Update() { if (rigidbody.SweepTest(transform.forward, hit, 0.5)) Debug.Log(hit.distance + "mts distance to obstacle"); if(transform.position.y &lt; -3) { mainGameScript.GameOver(); //Application.LoadLevel("Menu"); } } function IncreaseBallVelocity() { rigidbody.velocity *= 1.05; } function OnCollisionEnter(collision : Collision) { Instantiate(particles_splash, transform.position, transform.rotation); } </code></pre> <p><strong>EDITED added more info</strong></p> <ol> <li>Fixed Timestep = 0.02 Maximum Allowed Tir = 0.333</li> <li>There is no difference between running the game in editor player and on Android</li> <li>No. It looks OK when I set 0.01</li> <li>My Paddle is Box Collider without Rigidbody, walls are the same</li> <li>There are all in same layer (when speed is normal it all works) value in PhysicsManager are the default (same like in image) exept "Solver Interation Co..." = 50</li> <li>No. When I change speed it pass other wall</li> <li>I am using standard cube but I expand/shrink it to fit my screen and other objects, when I expand wall more then it's OK it bouncing</li> <li>No. It's simple project simple example from Video <a href="http://www.youtube.com/watch?v=edfd1HJmKPY">http://www.youtube.com/watch?v=edfd1HJmKPY</a></li> <li>I don't use gravity</li> </ol>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload