Missing method: Quaternion.FromLookDirectionLH() does it not exist?

I’m seeing FromLookDirectionLH in the Quaternion class but it seems like it doesn’t exist when I try and use it. Trying to orient a mesh to look in specific directions while still standing upwards away from the core of the planet. Any help would be great! Been running into a wall.

really looking for any equivalent to Unity’s Quaternion.LookRotation method

Are you running the latest version of Babylon?
Do you need your mesh to look up and down, or only left and right?

1 Like

I think so

Just left or right along the mini-planet’s horizon (think of mario galaxy) mario’s feet are always pointing to the core but he can turn and walk along the surface. I already have the up vector3 and the forward vector3 I need, I just need to orient the mesh.

cdn is for v4 which doesn’t have that method… If you want v5 you can change “cdn” to “preview” like below (but need to change it for all packages you’re using so version is same for all of them).

1 Like

This should be the same as LookRotation:

According to What is the source code of Quaternion.LookRotation? - Unity Answers

Not quite sure I’m happy with the results. I have done what you want before, but with vectors instead


I updated my cdn to a later version and both @Raggar’s version and the babylon FromLookDirectionLH seem to work the same way. Unfortunately they aren’t producing the results I was hoping. In the playground you shared @Raggar the cube base needs to always be pointing at the sphere center it’s “walking” around - and needs to consistently be looking/facing forward in the direction it’s moving. Thanks for your help up to here I appreciate it!

You can also use lookAt to look make the box face the sphere that it’s rotating around like on the below modified PG, if that’s what you’re after. That function is available in v4 too. :slight_smile:

1 Like

@Raggar @Blake thank you so much. Almost 8 hours straight suffering until I had your help! Thank you.