I’m trying to make a dead character match the surface angle of the terrain… and lerp smoothly to it… not just snap the character’s transform…
seems like it would be a no-brainer… but not so.
Getting the terrain surface normal, and lerping the character transform’s up vector to match, does indeed work… but it tends to rotate the character around ,so they all face the same direction, rather than leaving the character facing forwards… (probably to do with unity’s orthonormalize order ?)
e.g. character dies facing north, east or west… but by the end of the lerp, it rotates all characters to face south.
instead I tried getting the quaturnion to rotate the transform from the player’s current up vector to the surface normal vector… this also works… but it sometimes decides to flip the character the wrong way, almost through 360 degrees, to get to the correct final location.
eg, character starts off 15 degrees off correct… but instead of rotating 15 degrees… the quat decides to rotate the character (360-15) degrees
So both methods work… they just have ugly or undesired side effects.
any ideas ?
thanks