2D Toolkit Forum

2D Toolkit => Support => Topic started by: xecut on May 15, 2013, 06:12:11 am

Title: Box Collider vibrating
Post by: xecut on May 15, 2013, 06:12:11 am
Hi,

I want to make some objects there are pushable by player.

So I got some sprites that were attached with a rigidbody.
but they vibrates when the sprites landed on to a platform. Especially when rotated on the z axis, or when the character controller tries to push it.

How do I stop this?

my current gravity is -981...pretty high (using tk2dcamera.)
Is it the gravity's fault?

I am using a pushRigidBody script for my character controller too.
Code: [Select]
   void OnControllerColliderHit(ControllerColliderHit hit) {
        body = hit.collider.attachedRigidbody;
        if (body == null || body.isKinematic)
            return;
       
        if (hit.moveDirection.y < -0.3F)
            return;
       
        Vector3 pushDir = new Vector3(hit.moveDirection.x, 0, 0);
        body.AddForce(pushDir * pushPower);
    }
Title: Re: Box Collider vibrating
Post by: unikronsoftware on May 15, 2013, 10:00:03 am
Really hard to say without seeing it. Could be any number of things.
If you can send me a repro case to support.