modifying transform...strange result ?

I am copying terrain normal into transform.up of an object sittong on the surface of the terrain.
But doing this also rotates/snaps the model into facing a certain direction.
Seems like ut is using unit vectors for forwards and right… instead of doing an orthonormalize…

can anyone explain what is going on, and how to align my object to surface, without its rotation dissapearing.

thx

Assigning to the axis members on a Transform does that. “Up” isn’t enough to fully quantify a transform and so I suppose its inferring reasonable defaults for the other parts from that.

You probably need to take the cross product of Vector3.up and the ground normal. Also use AngleBetween to get the angle between those two normals. Build a quaternion off those and multiply it into the rotation on your object’s transform.

I’d suggest using Quaternion.FromToRotation() for this.