Forum rules - please read before posting.

Physics objects "bouncing" or "Jittering"

Hey!

So I am playing with implementing a few physics things in my game, something I've noticed though, if you pick up and object, and it collides with an object, it vibrates violently or bounces likes crazy. Is there a setting I can do to reduce this?

https://drive.google.com/file/d/106uh0jU0BKg_NJFV5G46x3p59PxM1hS0/view?usp=sharing

See at the end of the video the more violent bounces.

I can recreate this in the physics demo too it seems.

Comments

  • AC relies on Unity's physics system for its draggable object system.

    All the fields in Unity's Physics Settings panel, as well at the Rigidbody / Collider's Physics Materials can be adjusted to tweak behaviour.

  • I've tweaked the settings all over for physics but it still can cause the object to violently flying. Made bounce 0 etc.

    You can see in this video I lowered the break force more, and you can see when it flings away once it lets go. It's like its causing this opposite force on the object. Adding more breakforce stops the player from doing this, but causes some annoyance that if it taps other colliders lightly, causes the player to let go.

    https://drive.google.com/file/d/1PhrLzLKzOw-NQfxOQRHJW1kJ8mOrfX26/view?usp=sharing

    Seems like its how the two objects collide while the player is holding it causing the bug rather than the physics settings themselves?

  • How are you recreating this behaviour in the Physics demo?

  • Try freezing the Rigidbody's rotation - does that help?

  • https://imgur.com/g7Tpm7l

    Here it is in the physics demo, you can see I am not flinging it, I am just pulling the rock into another object till the breakforce triggers, causing it to fling the opposite direction.

    So I froze the rotations, it seems not to jitter or fling out, when I push it into other collision boxes. Likely thats where the core problem is?

  • It's a behaviour of the Rigidbody itself, so I can't comment much on how/why this improves things.

    You can attach this script, however, to the PickUp to have it auto-enable those locks when it's grabbed:

    using UnityEngine;
    using AC;
    
    public class FreezeRotationWhenHeld : MonoBehaviour
    {
    
        private void OnEnable ()
        {
            EventManager.OnGrabMoveable += GrabMoveable;
            EventManager.OnDropMoveable += DropMoveable;
        }
    
        private void OnDisable ()
        {
            EventManager.OnGrabMoveable -= GrabMoveable;
            EventManager.OnDropMoveable -= DropMoveable;
        }
    
        private void GrabMoveable (DragBase dragBase)
        {
            if (dragBase.gameObject == this.gameObject)
            {
                dragBase.Rigidbody.constraints = RigidbodyConstraints.FreezeRotation;
            }
        }
    
        private void DropMoveable (DragBase dragBase)
        {
            if (dragBase.gameObject == this.gameObject)
            {
                dragBase.Rigidbody.constraints = RigidbodyConstraints.None;
            }
        }
    
    }
    
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.