Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can I detect if the camera is looking to the left or right of the current heading?
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.
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

var projectedCameraForward  =  Vector3.ProjectOnPlane(cameraForward, splineOrientationUp); // You should handle the cases where projectedCameraForward is;

FluffyUnderware.DevTools.Extensions.Vector3Ext.AngleSigned(projectedCameraForward, splineTangent, splineOrientationUp)
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to detect bend in a spline or strait part of spline at position velikizlivuk 10 31 08-14-2023, 12:08 PM
Last Post: _Aka_
  Programming a first-person player/camera to follow a Curvy Spline kenmarold 1 6 05-21-2023, 05:03 PM
Last Post: _Aka_
  2D CurvyUISpline, Orthographic Camera and Handles MichaelH82 1 4 06-16-2022, 12:28 PM
Last Post: _Aka_
  Camera wobbles on too long spline (100km+) Vectorvision 10 8,023 08-01-2019, 12:35 PM
Last Post: _Aka_

Forum Jump: