Posts: 5
Threads: 3
Joined: Oct 2017
I need to establish a relative baseline for the 'center' Y rotation of the spline, that way if the camera is looking negative/positive of that number it will know the camera is looking left/right.
I'm hunting through the API but I'm a bit lost.
Posts: 2,114
Threads: 92
Joined: Jun 2017
I am assuming that your camera is on the spline.
What you want is the sign of the signed angle between the spline tangent and the camera forward.
try this
Code:
var projectedCameraForward = Vector3.ProjectOnPlane(cameraForward, splineOrientationUp); // You should handle the cases where projectedCameraForward is Vector3.zero;
FluffyUnderware.DevTools.Extensions.Vector3Ext.AngleSigned(projectedCameraForward, splineTangent, splineOrientationUp)
Please consider leaving a
review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.