How to match body's local rotation to a terrain mesh normal using a raycast?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Magso

I have a terrain using Zylann’s terrain plugin and a KinematicBody as the player. I can keep the player on the terrain but how do I rotate it to the terrain’s mesh?
I know I need to use look_at and get_collision_normal() but I can’t work out how to use them properly.
I found How to aling Y axis of a 3D object to another vector and tried to modify it to make the Z axis forward and ended up with

look_at(translation + Vector3.FORWARD, rayCastNode.get_collision_normal())

which works for the Z axis but the X axis is stuck at 0?

Thanks.