10-29-2018, 01:43 PM
In general, spline's data is expressed in spline's space, and you will need to convert them to global space when needed. So the tangent you get needs to be converted back to global space.
Then do this:
wheelFrontR.rotation = Quaternion.LookRotation(tangentInGlobalSpace, yourCarUp);
You might need to do an additional 90° rotation around the up vector, depending on the orientation of your mesh.
In general, when things go wrong, I advise you to debug things step by step, and visually. Use the Debug.DrawLine and similar methods to check the result at each significant step of your code, and I am sure you will rapidly find at which step things went wrong.
If after all this, you still can't manage to make the wheels align with the tangent, please send me a mini-project with everything setup, and I will take a look at it.
Then do this:
wheelFrontR.rotation = Quaternion.LookRotation(tangentInGlobalSpace, yourCarUp);
You might need to do an additional 90° rotation around the up vector, depending on the orientation of your mesh.
In general, when things go wrong, I advise you to debug things step by step, and visually. Use the Debug.DrawLine and similar methods to check the result at each significant step of your code, and I am sure you will rapidly find at which step things went wrong.
If after all this, you still can't manage to make the wheels align with the tangent, please send me a mini-project with everything setup, and I will take a look at it.
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.