How would I get the camera direction based on only the X and Z axis?

I am trying to create a dash based on the WSAD keys for direction. The problem is that the direction is based on the HumanoidRootParts CFrame which doesn’t feel very smooth, so I am trying to get the direction the camera is looking at by doing Camera.CFrame.LookVector instead. But the problem of that is that you can also dash on Y axis towards the ground/sky which I don’t want.

In conclusion: Am trying to get the direction the camera is looking at based on the Z and X axis.

Then multiply the lookvector by vector 3(1,0,1) to get rid of the y component hence only within the XZ plane.

4 Likes

Thank you it worked.

aaaaaaaaaaaaaa