- Home /
gravity problem
i have 3 identical gameobjects, they use unity physics, have rigidbodys and sphere colliders. sometimes 1 object changes his physic to a lower gravity, moves slower to the ground etc...but all rigidbody variables are similar to the other 2 objects... i need a hint what i could inspect yet to find the problem of this behavior
i use unity 2.6.1 pro trial version
Answer by Wolfram · Aug 17, 2010 at 09:20 PM
Things you can check: Are there other colliders somewhere, or are the colliders of these objects penetrating other colliders at startup? When exactly does this change happen? always with the same object? while interacting? Are there any scripts attached modifying the transform, or the rigidbody's velicoty etc? are the objects of unusual scale (say, >1000 or <0.01)? what are your game objects made of (meaning, is it maybe a mesh that maybe also has a collider somewhere in its hierarchy)? if you modify the rigidbody via script, is it correctly done in FixedUpdate() (as opposed to Update()?)
"When exactly does this change happen? always with the same object? while interacting?"
this is my problem, i dont know when this change happened...in the last 6 hours it happened only 3 times and i cant reproduce this bug. there are scripts modifying the position and the velocity, the objects are made with 3d studio max, one object as parent, child is a sphere with sphere collider and rigidbody and scripts, and 2 cylinder as childs from the sphere, always modifying the sphere velocity or position with the scripts (mostly with "OnCollisionEnter()" Events)...no collisions at start
if i destroy the objects rigidbody and add a new one, gravity is fine again...
Hm, glad it worked out! $$anonymous$$aybe one of the rigidbody's settings was causign this. One other thing I stumbled into myself just a few days ago - do you use the DontGoThroughThings script from the Unify wiki, to enhance the collision checks? I noticed it shows some weird effects (such as moving very slowly, or jumping back) if you don't exclude the object itself by placing it in a different layer (which the page explicitly mentions you need to do). Just a thought.
Was this resolved? I think I am having the same problem. If I instantiate an object, it has normal graivty, but all other instantiated objjects appear to fall slowly. All created the same way, all same mass, drag etc. I am using discrete collision, but this is true with or without collisions.