Make object move over other object in 3D space

Hey y’all, thanks for reading my question. I’m pretty new to Unity.

I’m trying to find a script that will allow an object to move over another one. By that I mean that when this object collides with another one, instead of being pushed forward, it will maintain its X and Y coordinates, but move around the form of the other object on Z.

Thanks again!

If you think about a problem that way : “I’m trying to find a script that will”, that’s not a good start. You should think of how to do it yourself. Even simple ones, need to learn how to walk before (etc).

In your case, it depends on how you’re moving your objects and how you can detect collision. Here are some leads : OnCollisionEnter, isKinematic, Translate or AddForce ?