- Home /
Bug? ( failed collision from golf simulation )
i have to make golf simulation game but i understand to make physics from Unity3d . i want to that someing below .
- adjust my golf simulation physics mathod(fly and roll, physic material) to Unity3d
- using unity collision
how can i do? could tell me please. i had to trying.
terrain(plane make to gameObject) meshCollider
Ball(GameObject)
-Transform
ball size : 0.04
-SphearCollider
radius : 0.5000001
-Rigidbody
mass : 0.045
drag : 0.012
angleDrag : 1
gravity = true;
isKinematic = false;
interpolate : no matter the value of
Collision Detection : no matter the value of
test one. rolling
1.before
push => o : ball
=============================== : plane
rigidbody.velocity = new Vector3(0,0,1);
2.after
=============================== : plane
o : ball
what is terrain through?
this is Bug?
Answer by · Oct 06, 2010 at 10:13 AM
I think you're asking why the ball goes through the plane when you set its velocity.
The rigidbody.velocity documentation says that "in most cases you should not modify the velocity directly, as this can result in unrealistic behaviour". You should instead use rigidbody.AddForce.
As for why it's falling through, with a ball that size, it might actually pass through the plane in a single update. I've never used meshcolliders before either, so I'm a bit on the dark there. I would personally recommend testing with a blank cube gameobject to get it working.
i'm sorry
i tried to rigidbody.velocity and rigidbody.addforce but it was impossible
so that increate size of SphearCollider radius : 0.5000001 => radius : 0.6 ummm... collision batter i don't want to this way
it's may be asked whether bug?
Answer by GODLIKE · Oct 06, 2010 at 01:16 PM
He may try to increase the time resolution for physics simulation and that would solve everything... and on a golf game I think that eating more cpu cycles shouldn't impact too much on performance and framerate.
"fixed time of physics" value is 0.001 or 0.0001 this value is same result