How to avoid gameObjects mixing/clipping with each other?

Hello all,

EDIT: I’ve been adviced to animate the whole scene and thus be in control of the avatar movement/ collision. Is that a good approach?

EDIT: Still looking for solution. I’ve tried:

  1. Navmesh Obstacle, very small one, on the carts - but it’s too costly and the Navmesh Agents are rigid about it.
  2. Navmesh agent on each cart! but the cart will lose its rotation and I can’t have it at the right rotation… agent.UpdateUpAxis doesn’t seem to work for me, although it was eccepted as the right answer in one of the answers.
  3. Tried having a cube in the cart, and a rigid body and in Import I’ve selected the Generate Collider.

I’m not giving up on this… still looking for help.

There must be a solution to this problem. It’s happening to each of us who builds game/simulation! It’s trivial and I must be missing here something obvious! Please see the picture for reference.
![alt text][1]
98453-avoidthis.jpg

The first image is taken from here.
Can you see how nicely they hold hands? And I can’t have the two carts not to collide… How hard can it be?
In my photo you can see how the two carts are inside each other, and avatars hand is inside other avatar head. ***bigger radius of agent will not work for me here.

The image from tomb raider shows a scripted animation. You can easily put two objects beside each other without them clipping.
Your second image however seems to be from a situation where the object positions are dynamically calculated based on … anything, really.
So you cannot really compare the two images to each other.

Ther is, however, a simple solution to your problem: Make the NavMeshAgent radius big enough to contain the cart.

@Adam-Buckner , @Mike-Geig
Sorry for tagging you guys but I really need to solve this problem…
I’ve been advised to check Generate Collider in import settings and to use IK.
You must have experienced this before.

hey , you can add colliders and rigidbody to carts , and also a joint for attaching them to players hand, you can combine this with IK animation solutions.

Hello all,
Quick update on solving this question… after posting and asking on Facebook various groups, forums, unity forum, @Jasper-Flick, and here of course, I’ve bought an asset, that uses a script with a similar logic of ray casting to avoid dynamic obstacles. It seems to be doing the work. I need to research a bit farther but if you need a link, no problem.

Regarding the carts entering the shelfs, I’ve limited their placement by mathf.clamp. I’ts not perfect but better.