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.