Rotating to a specific point using Transforms

I have a mechanic in my game project in which the player can fire out a raycast in the direction the camera is pointing. This raycast is locked on the Y axis, so the player only rotates it around the X and Z axis.

Currently I have this handled using a rotation function, which works fine but from what I understand it is better to do these things in 3D using Transforms. I spent a while messing around with rotation transform functions, but one thing I couldn’t figure out was how to manipulate a Transform’s rotation in order to look towards a specific point.

I’ve had a pretty hard time wrapping my head around Transforms, so I want to know if there is a way to do this or if it is just better to stick with using rotation for this case.

In Godot you can use the look_at function for Node3Ds and looking_at for Transform3D/Basis types.

I really missed it by three letters.

Thank you regardless.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.