Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Wheel control at the car
#6
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.
Available for freelance work, feel free to reach out: toolbuddy.net
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Reply


Messages In This Thread
Wheel control at the car - by xcube - 10-28-2018, 09:21 AM
RE: Wheel control at the car - by _Aka_ - 10-28-2018, 12:32 PM
RE: Wheel control at the car - by xcube - 10-28-2018, 02:48 PM
RE: Wheel control at the car - by _Aka_ - 10-28-2018, 03:29 PM
RE: Wheel control at the car - by xcube - 10-28-2018, 06:10 PM
RE: Wheel control at the car - by _Aka_ - 10-29-2018, 01:43 PM
RE: Wheel control at the car - by xcube - 10-30-2018, 10:15 AM
RE: Wheel control at the car - by ZNamibian - 10-30-2018, 03:30 PM
RE: Wheel control at the car - by xcube - 01-30-2020, 06:00 PM
RE: Wheel control at the car - by _Aka_ - 10-30-2018, 01:05 PM
RE: Wheel control at the car - by xcube - 01-30-2020, 07:07 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Control Point Interpolation Overrides. rickgplus 1 525 12-11-2025, 08:52 AM
Last Post: _Aka_
  OnAfterControlPointAdded - Control Point is null jh092 5 3,173 02-04-2025, 09:31 PM
Last Post: _Aka_
  How to generate gameobject on the control point Yang Yi 1 1,609 12-10-2024, 10:14 PM
Last Post: _Aka_
  Get position of all control points for a spline gekido 1 1,773 03-28-2024, 10:08 PM
Last Post: _Aka_

Forum Jump: