Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Generator does not exactly follow the path
#3
I have a lot of objects moving along the path, and rather non-standard calculations, I do not want to use built-in controllers or complex calculations like volume controllers. For moving I refer directly to the class CurvySpline like this:
float tf = 0;
int dir = 1;
Vector3 targetPos = mySpline.MoveByLengthFast(ref tf, ref dir, distance, CurvyClamping.Loop);
Vector3 ver = mySpline.GetOrientationUpFast(tf);
targetPos += ver * .5f;
Quaternion rot = mySpline.GetOrientationFast(tf);
myHero.transform.rotation = rot;
myHero.transform.position = targetPos+myHero.transform.right*shift;

when the path changes its height, road generator does not exactly follow this path, so my objects sometimes fly over it, and sometime goes inside the mesh. this problem does not exist on a straight line, only on hills, but even on small ones, so I think that the generator smoothes somewhere and does not exactly repeat the path
Reply


Messages In This Thread
RE: Generator does not exactly follow the path - by F.A.L. - 04-24-2023, 03:23 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  SplineController Ignores Follow-Up and Chooses Wrong Spline Josenildo 7 4,452 07-29-2025, 09:15 PM
Last Post: _Aka_
  How to rotate generator asteroids patndan74 6 3,816 05-08-2025, 10:07 PM
Last Post: _Aka_
  Duplicate Prefab along path rickgplus 1 1,543 01-23-2025, 10:09 AM
Last Post: _Aka_
  I have to refresh generator manualy :( GameDeveloperek4123 4 2,979 10-07-2024, 05:36 PM
Last Post: _Aka_

Forum Jump: