Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Wheel control at the car
#9
(10-30-2018, 10:15 AM)xcube Wrote: Thank you! It worked! I used tangent incorrectly.
Final code (can someone use to anyone)


Code:
       Vector3 wheelLocalPos = splinePos.InverseTransformPoint(wheelFrontR.transform.position);
       float frontWheelTf = spline.GetNearestPointTF(wheelLocalPos);
       tang = spline.GetTangent(frontWheelTf);

       wheelFrontR.transform.rotation = Quaternion.LookRotation(tang, new Vector3(0, 1, 0)); // turn wheel

Yes it really works ..
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
  Get position of all control points for a spline gekido 1 6 03-28-2024, 10:08 PM
Last Post: _Aka_
  Avoiding runtime GC allocations on control point position change Ell223 8 18 02-24-2024, 10:43 AM
Last Post: _Aka_
  Connection "next' control point jh092 3 15 11-22-2023, 11:47 AM
Last Post: _Aka_
  Custom Control Nodes Lupos 3 15 05-27-2023, 09:05 PM
Last Post: _Aka_

Forum Jump: