A object and another object has keep perpendicular.

A is a random show cube, B is a ground.

No matter the ground is plane or slope.

Every time when A show...

I want to let A always has keep perpendicular to B.

What can I do?

Thanks everybody!

1 Answer

1

If the ground is a plane it has a normal http://unity3d.com/support/documentation/ScriptReference/Plane.html.

You could also just grab the "up" vector of your ground and apply a rotation to make sure your cube has the same up vector.