So I’m kind of stuck with some basic CFrame related mathematics. If I had a theoretical part in the world that is rotated on multiple variable axes, and I want to move it forwards using CFrames where forwards is relative to the part, how would I do that?
I want to move the part in the direction of the arrow, while maintaining the Y level in the world and the rotation of the part.
I could just move it forwards and adjust the Y level relative to the world in a second step, but I want to be able to smoothly transition it forwards, and the Y rotation could theoretically be anything.
This is the best way to do it IMO and it’s how I’ve done it in the past. I would make 2 changes to the implementation.
Unitize moveForwardsOnXZPlane before you use it.
This won’t work if the LookVector is perfectly up or down. Check that the absolute value of its dot product with <0, 1, 0> is less than 0.0001. If that’s the case, then we know it’s looking pretty much straight up or down, so use the UpVector instead.